Skip to main content
Glama

Foundry MCP code mode

query

Read-onlyIdempotent

Run a read-only script against the connected Foundry world. code is the body of an async function: call foundry..({ ... }) (see docs), use await, console.log, and return the value you want back (JSON, size-limited). Only read methods are bound; writes are not available here — use execute. Every call counts against the per-script limits shown in the docs index (calls, wall time, CPU time, result size); an oversized call result arrives as { __truncated: true, bytes, limit, preview }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesBody of an async function: `const actors = await foundry.actors.list({}); return actors.length;`

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds substantial value beyond these: it discloses per-script limits (calls, wall time, CPU time, result size), the truncation behavior with the exact shape { __truncated: true, bytes, limit, preview }, and the requirement to write an async function with await. There is no contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph, but every sentence earns its place. It front-loads the core purpose, then explains the code parameter, then the read-only restriction, then limits and truncation. It is slightly longer than necessary but remains efficient and well-ordered.

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 read-only query tool, the description covers everything an agent needs: the async function format, the read-only scope, the alternative for writes, the limits, and the truncation behavior. It also references the docs for the API details. Even without an output schema, the agent can predict the return shape and error/truncation cases.

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% and the schema's `code` property includes a concrete example. The description goes further by explaining the async function contract: 'call foundry.<domain>.<method>({ ... }), use await, console.log, and return the value you want back (JSON, size-limited).' This adds meaning about return values and syntax beyond the schema, so a 4 is warranted.

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 opens with a specific verb and resource: 'Run a read-only script against the connected Foundry world.' It immediately distinguishes itself from the sibling execute by stating only read methods are bound and writes require execute. The agent can tell exactly what this tool does and how it differs from its siblings.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use context: it is for read-only queries. It explicitly states 'writes are not available here — use execute,' naming the alternative and the condition that selects it. It also points to docs for the API and mentions the per-script limits, so the agent knows what to expect.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources