Basic Tools¶
factorial_safe_forLLM¶
Returns n! with friendly error handling for invalid input.
@mcp.tool()
def factorial_safe_forLLM(n: int) -> str:
"""Return n! with friendly error handling for invalid input."""
Parameters
| Name | Type | Description |
|---|---|---|
n |
int |
Non-negative integer |
Example prompts
echo¶
Echoes back any message. The simplest possible MCP tool โ perfect for verifying the server is connected.
Parameters
| Name | Type | Description |
|---|---|---|
message |
str |
Any string |
Example prompts
Why echo?
The echo tool is the "Hello World" of MCP โ it proves the transport layer, server registration, and tool dispatch are all working before you touch anything more complex.