# MCP Tool

> The MCP Tool is a function exposed by an MCP server that an AI model can call to perform an action.

## What is a tool in MCP?

The capability of an MCP server that the model can call, such as 'create_issue' or 'query_database', described by a name, a description and a JSON Schema of its inputs. The description is what the model reads to decide when to use the tool.

- Topic: Model Context Protocol
- Type: concept

## Example

Wrong:

```json
{
  "name": "issue",
  "description": "Issue tool",
  "inputSchema": { "type": "object" }
}
```

Right:

```json
{
  "name": "create_issue",
  "description": "Create a new issue in the project tracker.",
  "inputSchema": {
    "type": "object",
    "properties": { "title": { "type": "string" }, "body": { "type": "string" } },
    "required": ["title"]
  },
  "annotations": { "destructiveHint": false }
}
```

A clear name, description and input schema tell the model when and how to call the tool.

## Key points

- Each tool has a clear description and a JSON Schema with required fields.
- Tools that change or delete data are kept separate from read-only tools and marked with annotations such as 'destructiveHint'.
- Inputs are validated on the server, not trusted because they came from the model.

## Interview questions

### What is the difference between an MCP tool and an MCP resource?

The model decides to call a tool to perform an action. The application decides which resources to load as read-only context.

### How should I name MCP tools?

Use short verb-noun names like 'create_issue' or 'search_docs', and avoid near-duplicates that make the model guess which to call.

### Can an MCP tool return images or files?

Yes, tool results are a list of content items that can include text, images, audio and links to resources.

## Related cards

- [MCP Server](https://wonderium.dev/ai/mcp-server.md)
- [Tool Calling](https://wonderium.dev/ai/tool-calling.md)
- [JSON Schema](https://wonderium.dev/ai/json-schema.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/mcp-tool
- Last updated: 2026-11-25
