Call tools on connected MCP servers as agent tools.
Basic Usage
1from inferencesh import mcp_tool23list_issues = (4 mcp_tool("list_issues", server="linear", tool_name="list_issues")5 .describe("List Linear issues with filtering and pagination")6 .build()7)How It Works
At load time, the runtime resolves each connector tool's description and input schema from the credential's cached tool list, with live fetch and a generic arguments fallback when needed. See Tool Schema and Description.
At call time, when the agent invokes a connector tool:
- Runtime loads the runner's own credential for the auth provider the server declares (
linear-mcp); with none, the chat pauses and asks them to connect one - Opens a fresh MCP session to the remote server
- Calls the specified tool with the agent's arguments
- Returns the result to the agent
Credentials are never exposed to the agent.
Parameters
| Parameter | Description |
|---|---|
name | Tool name the agent sees |
server | MCP server slug (linear). Saving a version refuses a server the workspace cannot use: MCP server "x" is not one this workspace can use |
toolName / tool_name | Tool name on the remote server (from belt mcp tools <slug>) |
Each call signs in with the runner's own credential for the server's auth provider: theirs, else their team's or org's. A tool doesn't pin a credential.
Python: mcp_tool(name, *, server, tool_name) (inferencesh ≥ v0.32.0). JavaScript: mcpTool(name, { server, toolName }) (@inferencesh/sdk ≥ v0.30.0). Older SDKs also accepted credential_id / credentialId; the API ignores it.
In agent YAML and stored tool JSON the fields under mcp are server and tool_name.
Builder Methods
| Method | Description |
|---|---|
mcpTool(name, { server, toolName }) | Create connector tool |
.describe(text) | Set description for LLM |
.display(name) | Human-readable name |
.requireApproval() | Require user approval |
.build() | Build the tool |
With Approval
For destructive operations:
1send_message = (2 mcp_tool("send_slack", server="slack", tool_name="send_message")3 .describe("Send a message to a Slack channel")4 .require_approval()5 .build()6)Finding Tool Names
List available tools on a connected server:
1belt mcp tools linear1linear — 24 tools23tool description4list_issues List issues with filtering and pagination5create_issue Create a new issue6update_issue Update an existing issue7...Use the tool name from this listing as the toolName parameter.
Full Example
1from inferencesh import mcp_tool23# Read-only tools4list_issues = (5 mcp_tool("list_issues", server="linear", tool_name="list_issues")6 .describe("List Linear issues for a project")7 .build()8)910get_issue = (11 mcp_tool("get_issue", server="linear", tool_name="get_issue")12 .describe("Get full details for a Linear issue")13 .build()14)1516# Write tools — require approval17create_issue = (18 mcp_tool("create_issue", server="linear", tool_name="create_issue")19 .describe("Create a new Linear issue")20 .require_approval()21 .build()22)2324notify_slack = (25 mcp_tool("notify_slack", server="slack", tool_name="send_message")26 .describe("Post a message to a Slack channel")27 .require_approval()28 .build()29)3031all_tools = [list_issues, get_issue, create_issue, notify_slack]Learn More
- Connectors Overview — what connectors are and how they work
- Browsing & Connecting — set up connections to MCP servers
- Agent Connector Tools — YAML config and examples