<!-- description: An MCP tool is a callable function exposed by an MCP server that an AI agent can invoke to perform actions — such as sending a message, creating a task, or reading data from an external system. -->

# MCP Tool

An **MCP tool** is a callable function exposed by an [MCP server](mcp-server) that an AI [agent](agent) can invoke to perform actions in the world. Tools are the primary mechanism through which agents extend their capabilities beyond text generation — enabling them to interact with external systems, APIs, file systems, and services.

## Anatomy of an MCP Tool

Each MCP tool has:

- **Name** — A unique identifier (e.g., `createTask`, `reply`)
- **Description** — Natural language explanation of what the tool does (used by the LLM to decide when to call it)
- **Input schema** — JSON Schema defining the parameters the tool accepts
- **Response** — The data returned to the agent after the tool executes

## AgentRQ MCP Tools

AgentRQ exposes the following tools to [Claude Code](claude-code) agents:

| Tool | Parameters | Description |
|------|-----------|-------------|
| `createTask` | `title`, `description`, `status` | Create a task on the task board |
| `reply` | `chat_id`, `message` | Send a message to the human |
| `getTaskMessages` | `chat_id` | Retrieve conversation history |
| `updateTaskStatus` | `task_id`, `status` | Set a task to ongoing or completed |
| `downloadAttachment` | `attachment_id` | Retrieve a file attachment |
| `getWorkspace` | — | Get workspace configuration |

## How the Agent Uses Tools

When a tool is available, the LLM can choose to call it by generating a structured tool call in its response. The [MCP client](mcp-client) intercepts this, executes the tool call against the server, and returns the result to the model as a new context entry.

```
1. Model generates: { "tool": "reply", "params": { "chat_id": "...", "message": "Done!" } }
2. MCP client calls AgentRQ's reply endpoint
3. AgentRQ delivers the message to the human's task board
4. MCP client returns: { "success": true } to the model
5. Model continues reasoning with updated context
```

## Related Terms

- [MCP](mcp)
- [MCP Server](mcp-server)
- [MCP Client](mcp-client)
- [Tool Use](tool-use)
- [Task](task)
