# X_AGENT_TOOL_UNDECLARED

## Means

an agent run offered a tool its declaration does not list

## Typical cause

an agent()'s offerTools() returned a name that is not one of the declared tools' names (the export name of an action, the name of an inProcessTool()). Refused before anything is loaded, reserved or sent: offerTools() narrows the declared catalogue for one run and can never add to it

## Fix

`return only names from the agent's tools from offerTools() — add the tool to tools: on the agent declaration first if the run really needs it`

[MCP and AI](/error-codes#mcp-and-ai)
