Skip to main content
Glama
oce-math-mcp

oce-math-mcp

by oce-projects

python_sandbox

Run short Python programs in a restricted sandbox to solve counting, brute-force, sequence, or multi-step math problems; returns printed output and the final expression value.

Instructions

Run a short Python program in a restricted interpreter for problems no other tool covers (counting, brute force, sequences, multi-step computations). Allowed imports: math, cmath, fractions, decimal, itertools, functools, collections, statistics, random, heapq, bisect, sympy, numpy, scipy, mpmath. No files, no network, 5 s limit. Returns printed output and the value of the last expression.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "python_sandbox"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesPython source, max 8000 characters. Use print() or end with an expression.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full disclosure burden and does well: it enumerates the allowed import whitelist, states the no-files/no-network sandbox restriction, gives the 5 s runtime cap, and describes exactly what is returned (printed output plus last expression value). Gaps remain around error/exception behavior and resource limits such as memory, which matter for a code-execution tool.

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?

Three dense sentences: purpose and scope first, then the environment restrictions, then the return contract. Every clause earns its place and nothing is repeated from the schema.

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

Completeness4/5

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

For a single-parameter code executor with no annotations and no output schema, the description covers the sandbox, the import whitelist, the time limit, and the return format – everything an agent needs to decide and call correctly. Error semantics and memory limits are the remaining omissions, but they are secondary for correct invocation.

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

Parameters4/5

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

Schema coverage is 100% for the single parameter, so the baseline is 3; the description adds genuine meaning beyond the schema by defining the execution environment that constrains what the code may contain (whitelisted imports, no I/O, short runtime). It does not add per-parameter syntax detail, but the schema already covers the character limit and print/expression convention.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Run a short Python program in a restricted interpreter') and adds a concrete scope statement plus example problem classes (counting, brute force, sequences, multi-step computations). Sibling differentiation is present only as a generic fallback framing ('problems no other tool covers') rather than naming which of math_eval, math_numeric, or number_theory it supersedes, so an agent still has to infer the boundary.

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

Usage Guidelines4/5

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

It clearly states the selection condition: use this when no other tool covers the problem, with examples of what that looks like. It also implies hard usage limits (5 s, no files/network) that tell an agent when this tool will fail. It stops short of explicitly naming an alternative tool for the cases this one is not meant for.

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