Skip to main content
Glama
srmcguirt

FastMCP Python Boilerplate

by srmcguirt

calculate

Safely evaluate arithmetic expressions with +, -, *, /, //, %, **, and parentheses. Returns precise results without enabling function calls, variables, or imports.

Instructions

Safely evaluate a simple arithmetic expression and return the result.

Supported: +, -, *, /, //, %, ** and parentheses. No function calls, variables, or imports are allowed.

Examples: "2 + 2" → 4.0 "10 / 3" → 3.3333... "(3 + 4) * 2" → 14.0 "2 ** 8" → 256.0

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the operation is safe, enumerates supported operators, and prohibits function calls, variables, and imports, effectively communicating that no arbitrary code execution occurs. It does not cover error behavior or division-by-zero handling, but the core safety behavior is well disclosed.

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?

The description is compact and front-loaded with the purpose, follows with supported operations and restrictions, and uses examples to clarify expected behavior. Every sentence contributes useful information without redundancy.

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

Completeness5/5

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

For a single-parameter calculator with an output schema, the description is sufficiently complete: it defines valid inputs, supported operations, restrictions, and example outputs. No critical information is missing for an agent to select and invoke the tool correctly.

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

Parameters5/5

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

The schema provides only a string type with no description, so the description must compensate. It does so thoroughly by defining what the 'expression' parameter must be, supported operators, syntax rules, and concrete examples. This is exactly the meaning the schema lacks.

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 a specific verb ('evaluate') and resource ('simple arithmetic expression') and indicates the result is returned. It differentiates from sibling tool 'echo' by emphasizing evaluation rather than echoing, and lists supported operations to remove ambiguity.

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

Usage Guidelines3/5

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

The description gives clear boundaries for what expressions are valid (arithmetic only, no function calls, variables, or imports), so the intended use is implied. However, it does not explicitly mention when to prefer this tool over the sibling 'echo' or what types of tasks should not use it.

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

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/srmcguirt/fastmcp-python-boilerplate'

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