Implementation:1mcp app Agent toolsCommand
| Knowledge Sources | |
|---|---|
| Domains | CLI, MCP_Protocol |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete CLI command for listing, inspecting, and disabling individual tools within a specific MCP server at runtime.
Description
The toolsCommand function provides tool-level management for a specific MCP server. It can list all tools exposed by a server, show disabled tools, disable specific tools by name, and estimate token usage for tools. It connects to the running runtime via McpConnectionHelper to inspect the live tool list and updates the config file when disabling tools.
Usage
Import this function when you need to:
- List all tools available within a specific MCP server
- Disable specific tools to reduce token overhead or hide unwanted functionality
- Show currently disabled tools for a server
- Estimate token usage for specific tools using a model-aware calculator
Code Reference
Source Location
- Repository: 1MCP Agent
- File: src/commands/mcp/tools.ts (L393)
Signature
export interface ToolsCommandArgs extends GlobalOptions {
server: string;
tool?: string;
disabled?: boolean;
model?: string;
}
export function buildToolsCommand(yargs: Argv): Argv;
export async function toolsCommand(argv: ToolsCommandArgs): Promise<void>;
Import
import { toolsCommand, buildToolsCommand } from '@src/commands/mcp/tools.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| server | string | Yes | Server name |
| tool | string | No | Tool name to disable |
| disabled | boolean | No | Show disabled tools |
| model | string | No | Token estimation model |
Outputs
| Name | Type | Description |
|---|---|---|
| stdout | formatted text | Tool list or tool details |
| config file | side effect | Updated when disabling tools |
Usage Examples
List and Disable Tools
1mcp mcp tools my-server
1mcp mcp tools my-server --disabled
1mcp mcp tools my-server --tool=unwanted_tool