Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Add Tool to MCP Server

sf_create_mcp_tool

Add a new tool definition to an existing MCP server project by modifying src/index.ts. Provide tool name, description, JSON schema, and handler code; the registration is inserted before server start, then run npm run build.

Instructions

Adds a new tool definition to an existing MCP server project by reading the src/index.ts file and appending the tool registration. Provide the tool name, description, input schema as a JSON object (field names to {type, description}), and handler code. The tool code is inserted before the 'Start server' section. Run 'npm run build' after adding tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNameYesTool API name, e.g. 'get_account_data'
handlerCodeYesTypeScript handler function body code
inputSchemaYesJSON Schema for the tool's input parameters
toolDescriptionYesDetailed description of what the tool does
projectDirectoryYesAbsolute path to the MCP server project directory
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that it reads src/index.ts, appends tool registration, and inserts code before the 'Start server' section. It also instructs to run npm run build, adding meaningful behavioral detail beyond annotations which provide no hints. This aligns with destructiveHint=false as the insertion is non-destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with no filler. The main purpose is front-loaded, and each sentence delivers necessary information: operation, required inputs, insertion location, and build instruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a code-modification tool with no output schema, it covers the essential workflow: file read, code placement, and post-action build command. Missing prerequisites/error handling but schema richness and operational guidance make it fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers all parameters with descriptions (100% coverage), giving a baseline of 3. The description adds extra meaning by specifying the inputSchema structure as 'field names to {type, description}' and clarifying the insertion point relative to the 'Start server' marker, enhancing understanding beyond schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it adds a tool definition to an existing MCP server project, with a specific verb ('Adds') and resource. It distinguishes from siblings like sf_create_mcp_server (creating the server) and sf_list_mcp_tools (listing tools) by focusing on modifying an existing project.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides context for when to use: for existing MCP server projects, and includes an operational step ('Run npm run build after adding tools'). It doesn't explicitly list alternatives or exclusions, but the distinction from sf_create_mcp_server is implicit, giving clear context without formal exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/semwalajay83-sem/salesforce-metadata-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server