agentleFS
justnau1020justnau1020/claude-os/skills/development/new-mcp-tool/SKILL.md

new-mcp-tool

Skill3 starsChanged 8 months agoApache-2.0View on GitHub

Add a new MCP tool to a FastMCP server. Use when adding a new tool for LLM agents or extending the MCP interface with new functionality.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add a tool to the project's FastMCP server.

    line 10
  2. Distinctive:

    Read the MCP server file to understand current tool patterns and the FastMCP setup.

    line 20
  3. Very specific:

    Async only: All tool functions must be async def

    line 48
  4. Distinctive:

    Actionable errors: If something fails, return a helpful error string, not a generic one

    line 50
  5. Distinctive:

    Respect data boundaries: All data queries should respect the project's access control and data validation rules

    line 51
  6. Distinctive:

    Add tests for the new tool's logic.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add a New MCP Tool

Add a tool to the project's FastMCP server.

Arguments

  • $ARGUMENTS -- Tool name in snake_case (e.g., get_user_profile)

Steps

1. Read the existing MCP server

Read the MCP server file to understand current tool patterns and the FastMCP setup.

2. Add the tool

@mcp.tool()
async def $ARGUMENTS(
    param1: str,
    param2: int = 10,
) -> str:
    """Clear description of what this tool does and when an LLM should use it.

    Include example parameter values to help LLMs understand expected input.
    Example: param1="example_value", param2=30
    """
    ...

3. Tool description conventions

The tool description is critical -- it's how LLMs decide when to call it:

  • First sentence: what the tool does
  • Second sentence: when to use it
  • Include parameter examples inline
  • Mention any constraints (rate limits, data availability)

4. Implementation conventions

  • Async only: All tool functions must be async def
  • Return strings: MCP tools return string responses for LLM consumption
  • Actionable errors: If something fails, return a helpful error string, not a generic one
  • Respect data boundaries: All data queries should respect the project's access control and data validation rules

5. Write tests

Add tests for the new tool's logic. Test:

  • Happy path with valid parameters
  • Error handling with invalid parameters
  • Data validation on returned data

6. Verify

pytest tests/ -v -k "mcp"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.