> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tool • Rust AI Agent SDK

> MCPTool: An MCP tool definition.

# MCPTool

> Defined in the [**MCP**](../modules/mcp) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

An MCP tool definition.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: MCPTool"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Fields

| Name           | Type                | Description                |
| -------------- | ------------------- | -------------------------- |
| `name`         | `String`            | Tool name                  |
| `description`  | `String`            | Tool description           |
| `input_schema` | `serde_json::Value` | Input schema (JSON Schema) |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(name: impl Into<String>, description: impl Into<String>) -> Self
```

Create a new MCP tool

**Parameters:**

| Name          | Type                      |
| ------------- | ------------------------- |
| `name`        | `impl Into&lt;String&gt;` |
| `description` | `impl Into&lt;String&gt;` |

### `input_schema`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn input_schema(mut self, schema: serde_json::Value) -> Self
```

Set input schema

**Parameters:**

| Name     | Type                |
| -------- | ------------------- |
| `schema` | `serde_json::Value` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/mcp/mod.rs#L263">
  `praisonai/src/mcp/mod.rs` at line 263
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Tools" icon="wrench" href="/docs/rust/tools" />

  <Card title="Rust Code Execution" icon="terminal" href="/docs/rust/code-execution" />

  <Card title="Rust Web Search" icon="search" href="/docs/rust/web-search" />

  <Card title="Rust MCP" icon="plug" href="/docs/rust/mcp" />

  <Card title="Rust Resources" icon="folder" href="/docs/rust/resources" />
</CardGroup>
