Skip to main content
Tools are the functions your MCP server exposes to AI assistants. When an LLM decides it needs to perform an action—like searching documents, creating issues, or fetching data—it calls one of your tools. You can use FastMCP (recommended) or the low-level Server API. Both are fully supported.

Basic Tool

Here’s a simple tool that searches documents. Notice the type annotations and docstring—these are essential for LLMs to understand and use your tool correctly.

Requirements

Every tool needs a few things to work properly with Gumstack and LLMs. Missing any of these will cause issues.

Declare in config.yaml

Every tool must be declared in config.yaml:
The name must match your function name exactly. Without this, Gumstack won’t detect the tool.

Return type annotation

Every tool must have a return type. This generates the output schema that Gumloop uses for node connections.

Docstrings

LLMs use docstrings to decide when to call your tool. Be specific:

Parameter descriptions

Use Annotated with a string or Field(description=...):

Supported types

FastMCP supports all Pydantic types:

Common Mistakes

These patterns cause problems in production. Avoid them to keep your tools reliable and debuggable.

One Tool, One Job

Resist the urge to create “swiss army knife” tools that do multiple things. Split complex operations into focused tools for better:
  • Observability — See exactly which operation failed
  • Access control — Admins can restrict specific actions
  • LLM accuracy — Simpler tools are easier to use correctly

Low-level Server API

FastMCP handles most use cases, but if you need fine-grained control over tool registration and responses, you can use the low-level Server class directly:
See the MCP Python SDK and FastMCP docs for full API reference.