CtrlK
BlogDocsLog inGet started
Tessl Logo

finkel/mcp-tool-naming

Guidelines for naming MCP tools, describing parameters, and documenting tools in a language- and framework-agnostic manner

97

1.02x
Quality

Pending

Does it follow best practices?

Impact

97%

1.02x

Average score across 5 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

index.mddocs/

MCP Tool Naming Guidelines

Comprehensive guidelines for naming MCP (Model Context Protocol) tools, describing parameters, and documenting tools in a language- and framework-agnostic manner.

Introduction

MCP tools are the building blocks that extend AI assistant capabilities. Consistent naming, clear parameter descriptions, and comprehensive documentation enable agents to understand and use tools effectively across different implementations.

This tile provides language- and framework-agnostic guidelines for:

  • Tool naming conventions – Creating predictable, discoverable tool names
  • Parameter descriptions – Defining clear, consistent parameter metadata
  • Tool documentation – Writing effective descriptions and examples
  • Best practices – Ensuring cross-platform compatibility

Naming Conventions

Tool names should be predictable, discoverable, and consistent across implementations.

General Principles

PrincipleDescriptionExample
PredictableNames should follow consistent patterns that agents can infersearch_web, read_file, execute_query
DiscoverableSimilar tools should be grouped by prefixes or naming patternsgithub_search_repos, github_get_issue
ConsistentUse the same naming style across all tools in a serverAll lowercase with underscores (snake_case) or hyphens (kebab-case)
Action-orientedStart with a verb describing what the tool doescreate, read, update, delete, search, validate
Domain-prefixedPrefix with domain when tools belong to specific domainsfs_read, http_fetch, db_query

Case Styles

Choose one case style and use it consistently across all tools:

StyleFormatExampleWhen to Use
snake_caseLowercase with underscoressearch_github_repositoriesMost common, highly readable
kebab-caseLowercase with hyphenssearch-github-repositoriesCommon in CLI tools and URLs
camelCaseLowercase first letter, capitals for subsequent wordssearchGithubRepositoriesJavaScript/TypeScript conventions
PascalCaseCapital first letter, capitals for subsequent wordsSearchGithubRepositoriesTypically used for types/classes, not tools

Recommendation: Use snake_case for maximum cross-language compatibility.

Prefixing Strategies

Prefix tools to group related functionality and avoid name collisions:

StrategyExampleUse Case
Domain prefixgithub_, sql_, file_Tools from a specific domain or service
Operation prefixcreate_, read_, update_, delete_CRUD operations on resources
Source prefixmcp_, system_, custom_Distinguish between built-in and custom tools

Tool Name Examples

Good NamesBad NamesWhy
search_webwebSearch (inconsistent case)Consistent snake_case, action-oriented
github_get_repogetGithubRepo (mixes styles)Domain-prefixed, predictable
file_readreadFile (no domain prefix)Clear domain grouping
db_execute_queryexecuteQuery (ambiguous domain)Explicit domain prefix

Parameter Descriptions

Clear parameter descriptions are essential for agents to understand how to use tools correctly.

Parameter Metadata Structure

Each parameter should include:

FieldPurposeExample
NameIdentifier used in tool callsquery, file_path, limit
TypeData type of the parameterstring, integer, boolean, array, object
DescriptionClear explanation of what the parameter does"Search query string"
RequiredWhether the parameter is mandatorytrue or false
ConstraintsValidation rules (optional)min: 1, max: 100, pattern: "^[a-z]+$"
ExamplesExample values (optional)"example query", 42, true

Writing Effective Descriptions

DoDon'tWhy
Use clear, concise languageUse technical jargon without explanationAgents need to understand the purpose
Specify units when relevantAssume default unitstimeout_ms vs timeout (milliseconds vs seconds)
Include constraints in descriptionHide constraints in type only"Maximum number of results (1-100)"
Provide examples for complex parametersLeave examples out"JSON object with 'id' and 'name' fields"

Type Definitions

Use simple, language-agnostic types that map to common programming language types:

MCP TypeDescriptionCommon Mappings
stringText datastr (Python), string (Go/TypeScript), NSString (Swift)
integerWhole numbersint (Python), number (TypeScript), int64 (Go)
numberFloating-point numbersfloat (Python), number (TypeScript), float64 (Go)
booleanTrue/false valuesbool (Python), boolean (TypeScript), bool (Go)
arrayOrdered list of valueslist (Python), Array (TypeScript), []interface{} (Go)
objectKey-value mappingdict (Python), Object (TypeScript), map[string]interface{} (Go)

Parameter Examples

{
  "name": "search_web",
  "description": "Search the web for information",
  "parameters": [
    {
      "name": "query",
      "type": "string",
      "description": "Search query string",
      "required": true,
      "examples": ["latest Python release", "weather in London"]
    },
    {
      "name": "limit",
      "type": "integer",
      "description": "Maximum number of results (1-20)",
      "required": false,
      "default": 10,
      "constraints": {"min": 1, "max": 20}
    },
    {
      "name": "use_safe_search",
      "type": "boolean",
      "description": "Enable safe search filtering",
      "required": false,
      "default": true
    }
  ]
}

Tool Documentation

Comprehensive tool documentation helps agents understand when and how to use each tool.

Tool Description Structure

SectionPurposeExample
NameTool identifierread_file
DescriptionHigh-level purpose"Read contents of a file from the filesystem"
ParametersInputs the tool acceptsfile_path (string), encoding (string, optional)
ReturnsWhat the tool outputs"File contents as string"
ErrorsPossible error conditions"File not found", "Permission denied"
ExamplesExample tool callsread_file("config.json")
When to UseGuidance on appropriate usage"Use when you need to read configuration or data files"

Writing Tool Descriptions

Good DescriptionBad DescriptionWhy
"Search for repositories on GitHub using the GitHub API""GitHub repo search"Clearly states purpose and source
"Execute a SQL query against a database and return results""Run SQL"Specifies input/output and context
"Convert temperature between Celsius and Fahrenheit""Temperature converter"Explains functionality clearly
"Use active voice and complete sentences in tool descriptions""Tool for X" or "Does Y"Active voice and complete sentences make descriptions clearer and more professional

Professional Documentation Guidelines

For production-quality tool documentation, follow these advanced guidelines:

GuidelineDescriptionExample
One-liner firstStart with action + object description. No fluff."Create refund for charge" not "This tool allows you to create a refund for a charge"
Inputs tightName, type, required/optional, constraints. Call out enums and max sizes.limit: integer, required: false, constraints: {min: 1, max: 100}, description: "Maximum results (1-100)"
Output contractDescribe JSON shape and stable keys. Note nullable fields.`{id: string, amount: number, currency: string, status: "pending"
Side effects + scopeWhat changes in the system, required auth/tenant, idempotency key support."Creates a new user record. Requires admin authentication. Supports idempotency keys."
Failure modesCommon errors with short "when/why" notes for retry/fallback.INVALID_PARAMETER: "When input validation fails - check parameter types and constraints"
Tiny exampleOne happy path, one edge case. Minimal to avoid prompt bloat.Happy: {"query": "python", "limit": 10} Edge: {"query": "", "limit": 1}
Reuse hintingTags like read/write, billing, high-latency, deprecation/version notes.tags: ["write", "billing", "high-latency"], deprecated: "Use v2 endpoint after 2025-01-01"
New hire mindsetDescribe tools as if to a new team member. Make implicit context explicit.Explain specialized query formats, niche terminology, resource relationships that experts assume.

Key Principle: When writing tool descriptions and specs, think of how you would describe your tool to a new hire on your team. Consider the context that you might implicitly bring—specialized query formats, definitions of niche terminology, relationships between underlying resources—and make it explicit.

Error Documentation

Document possible error conditions and their meanings:

ErrorDescriptionPossible Causes
FILE_NOT_FOUNDThe specified file does not existInvalid path, missing file
PERMISSION_DENIEDInsufficient permissions to access the resourceFile permissions, user rights
INVALID_INPUTInput parameters fail validationWrong type, missing required fields
NETWORK_ERRORNetwork request failedServer unreachable, timeout
RATE_LIMITEDToo many requestsAPI rate limits exceeded

Example Tool Documentation

{
  "name": "github_search_repositories",
  "description": "Search for GitHub repositories by keyword, language, or other criteria. Returns matching repositories with metadata.",
  "parameters": [
    {
      "name": "query",
      "type": "string",
      "description": "Search query (supports GitHub search syntax)",
      "required": true,
      "examples": ["language:python", "tensorflow stars:>1000"]
    },
    {
      "name": "sort",
      "type": "string",
      "description": "Sort field: stars, forks, updated",
      "required": false,
      "default": "stars",
      "enum": ["stars", "forks", "updated"]
    },
    {
      "name": "per_page",
      "type": "integer",
      "description": "Results per page (1-100)",
      "required": false,
      "default": 30,
      "constraints": {"min": 1, "max": 100}
    }
  ],
  "returns": {
    "type": "array",
    "description": "List of repository objects with id, name, description, stars, etc."
  },
  "errors": [
    {"code": "INVALID_QUERY", "description": "Search query syntax is invalid"},
    {"code": "RATE_LIMITED", "description": "GitHub API rate limit exceeded"},
    {"code": "NETWORK_ERROR", "description": "Failed to connect to GitHub API"}
  ],
  "examples": [
    {
      "description": "Search for Python machine learning repositories",
      "parameters": {"query": "machine learning language:python", "sort": "stars"}
    }
  ]
}

Best Practices

Language- and Framework-Agnostic Documentation

PracticeDescriptionImplementation
Avoid implementation detailsDon't reference specific programming languages or frameworksUse "string" not "NSString" or "std::string"
Use generic type namesStick to basic types that map across languagesstring, integer, array, object
Document behavior, not implementationDescribe what the tool does, not how it's implemented"Searches the web" not "Makes HTTP GET request to Google"
Provide examples in multiple formatsShow tool calls in different syntaxes when possibleJSON-RPC, CLI, REST-like examples
Include cross-platform considerationsNote platform-specific behavior if relevant"On Windows, paths use backslashes"

Consistency Across Tools

  • Use the same parameter names for similar concepts (file_path vs filename vs path)
  • Maintain consistent ordering of parameters (required first, optional after)
  • Follow the same documentation structure for all tools
  • Use the same error format across all tools

Discoverability and Organization

  • Group related tools with consistent prefixes
  • Provide a tool index or categorization
  • Include "see also" references to related tools
  • Document tool dependencies or prerequisites

Validation and Constraints

  • Document all validation rules in parameter descriptions
  • Provide meaningful error messages for constraint violations
  • Include examples of valid and invalid values
  • Document default values for optional parameters

Examples

Good Tool Definition

{
  "name": "weather_get_current",
  "description": "Get current weather conditions for a location",
  "parameters": [
    {
      "name": "location",
      "type": "string",
      "description": "City name, postal code, or coordinates (lat,lon)",
      "required": true,
      "examples": ["New York", "10001", "40.7128,-74.0060"]
    },
    {
      "name": "units",
      "type": "string",
      "description": "Temperature units: metric (Celsius) or imperial (Fahrenheit)",
      "required": false,
      "default": "metric",
      "enum": ["metric", "imperial"]
    }
  ],
  "returns": {
    "type": "object",
    "description": "Weather data including temperature, conditions, humidity, wind"
  }
}

Poor Tool Definition

{
  "name": "getWeather",
  "description": "Gets weather",
  "parameters": [
    {
      "name": "loc",
      "type": "str",
      "required": true
    }
  ]
}

Issues: Inconsistent naming (getWeather vs snake_case), vague description, ambiguous parameter name (loc), language-specific type (str), missing parameter description and examples.

References

  • Model Context Protocol (MCP) Specification
  • MCP Tools Documentation
  • OpenAPI Specification – Inspiration for API documentation patterns
  • JSON Schema – For parameter validation definitions

Summary

Effective MCP tool documentation requires:

  1. Consistent naming using snake_case with domain prefixes
  2. Clear parameter descriptions with types, constraints, and examples
  3. Comprehensive tool documentation covering usage, errors, and examples
  4. Language-agnostic practices that work across implementations
  5. Organized structure for discoverability and maintenance

Following these guidelines ensures that MCP tools are predictable, discoverable, and usable by AI agents across different platforms and implementations.

docs

index.md

tile.json