Skip to main content
Glama
SheetForge MCP

SheetForge MCP

by iHeldan

run_workbook_recipe

Destructive

Preview or commit a reusable JSON recipe to group, filter, and summarize workbook data into a reserved output range, with contract checks and verification before writing.

Instructions

Preview or commit a reusable JSON recipe without echoing intermediate rows.

Recipe v1 requires version=1, source={table_name, optional sheet_name},
group_by=[exact header names], metrics=[{op, field, as}], and
output={sheet_name, range_ref, optional allow_overwrite=false}.
Optional filters use query_table operators; optional checks support unique_key
(fields), row_count (min/max), and sum_matches (source_field/output_field).
count metrics omit field. Other metrics: sum, avg, min, max, count_non_null,
count_distinct. Only literal finite JSON cells in referenced fields are supported.
Filter guards interpret operator case/whitespace exactly as execution does;
text operators still require text fields and blank checks forbid operands.
Valid retained operator spelling is not rewritten when checking a receipt.
Invariance compares exact keyed groups, not presentation row order; numeric
metric tolerances do not apply to group identities.
Optional workbook_contract enforces Contract v1: source selectors must match,
ALL Recipe input references must use contract fields[].name, NEVER physical
fields[].headers. Copy names from inspection.recipe_input_fields (binding keys).
Example: net bound to NetSales -> metrics=[{op:"sum",field:"net",as:"Revenue"}];
currency bound to Currency -> group_by=["currency"]. The as label stays Revenue.
This also applies to filters.field, unique_key.fields and sum_matches.source_field.
Contract field errors return bounded details.examples with Recipe JSON-pointer
paths and exact replace_with names where known: fix the Recipe references only,
keep workbook_contract unchanged, then make a NEW preview before commit.
Contract filters are mandatory
AND predicates. All contract rows are checked before filtering and again on
the saved workbook. Repeat the identical contract on commit; changed contracts
invalidate recipe tokens. Declared meanings are not verified business truth.

Output is one reserved rectangle in the same workbook, fully replaced including
blank padding. Occupied output requires allow_overwrite=true; table/merge overlap
is rejected. Preview first, then commit the unchanged recipe with recipe_token
and expected_workbook_sha256 from preview. A verified snapshot is always enabled.
Limits: 50,000 source cells, 64 source columns, 10,000 output cells; sample_limit 1-10.
include_report_receipt optionally returns a client-owned value fingerprint ONLY
after verified commit. Passing preview budgets it but returns no receipt;
failed checks retain their verification report without constructing a receipt.
Supply the flag on both preview and commit. Use check_report_receipt before a later refresh;
receipts are not signatures, write authorization or automatic conflict resolution.
New receipt format 3 binds effective output headers and exact finite numeric
identity throughout its checksum; actual JavaScript rounding still fails.

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": {
      "filepath": "<filepath>",
      "recipe": "<recipe>"
    },
    "name": "run_workbook_recipe"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNopreview
recipeYes
filepathYesReuse supplied server path; NEVER prepend client cwd. Rooted: relative OK; unrooted stdio: absolute, ask if missing.
recipe_tokenNo
sample_limitNo
workbook_contractNo
include_report_receiptNo
expected_workbook_sha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.0
    • addedInput schema / properties / include_report_receipt
      Added value: +{
      +  "default": false,
      +  "title": "Include Report Receipt",
      +  "type": "boolean"
      +}
  2. Addedv0.14.0

TDQS

A4.4/5.0
Behavior5/5

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

The description goes far beyond the single destructiveHint=true annotation: it discloses that output is one reserved rectangle fully replaced including blank padding, that occupied output needs allow_overwrite=true, that table/merge overlap is rejected, that contract changes invalidate recipe tokens, and that receipts are not signatures or write authorization. Cell/column limits and sample_limit bounds are also stated.

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

Conciseness3/5

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

It is front-loaded with the purpose and the preview/commit workflow, but the middle is a dense wall of sentence fragments covering contract binding, receipts, and limits with no structural separation. Much of it earns its place given the complexity, yet bullets or grouping by phase (recipe authoring, contract, output, receipts) would make it far easier to scan.

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 an 8-parameter tool with nested free-form recipe and contract objects and no output schema, the definition covers the authoring model, the safety/overwrite rules, contract enforcement, and the receipt lifecycle. It stops short of describing the actual response payload (sample rows, verification report shape) beyond noting preview returns no receipt, which leaves some return-value ambiguity.

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 only 13%, so the description must carry the burden, and it largely does: it defines Recipe v1's version/source/group_by/metrics/output/filters/checks structure, the allowed metric ops, and the semantics of workbook_contract, recipe_token, expected_workbook_sha256, include_report_receipt, and the 1-10 sample_limit range. Gaps remain for mode's default behavior and the exact interaction between sample_limit and receipt verification, and filepath semantics live only in the schema.

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 opening sentence names a specific verb pair and resource ('Preview or commit a reusable JSON recipe') and adds a scope qualifier ('without echoing intermediate rows'). This is unmistakably different from sibling tools like query_table, apply_workbook_changeset, or run-style repair tools.

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?

The description gives strong sequencing guidance: 'Preview first, then commit the unchanged recipe with recipe_token and expected_workbook_sha256 from preview', plus 'Use check_report_receipt before a later refresh' and 'Repeat the identical contract on commit'. What it lacks is explicit routing against the closest sibling (apply_workbook_changeset) — it never says when to use a recipe versus a changeset.

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

Deploy Server

Other Tools