Skip to main content
Glama

Evaluate rules

evaluate-rules

Runs every rule targeting the given structure (plus element- and association-scoped rules for the structure's atoms), binds $Variable references to in-scope facts via qname lookup, writes one VerificationResult row per rule, and returns the results plus a status-keyed summary. Decoding mode, 6 patterns (EqualTo, RollUp, RollForward, SumEquals, Exists, CoExists).

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "structure_id": "str_balance_sheet"
    },
    "name": "evaluate-rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
entity_idNoThe entity whose facts bind, when no `fact_set_id` pins them; default the group parent. On a group, each entity's statements share the structure.
period_endNoUpper bound on the fact period window (inclusive).
fact_set_idNoOptional FactSet id to stamp on each VerificationResult row. Allows results to be scoped to a specific period run once write paths populate the FactSet table on every run.
period_startNoLower bound on the fact period window (inclusive).
structure_idYesStructure to evaluate rules for. Resolves all rules scoped to this structure plus rules attached to its elements and associations.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already flag readOnlyHint=false and idempotentHint=false, so the description's job is to explain the write. It does: one VerificationResult row is written per rule, $Variable references are bound via qname lookup, and fact binding defaults to the most recent in_scope fact when no period window is given — a non-obvious default that materially changes results. It does not cover failure modes or what happens on re-runs (relevant given idempotentHint=false), which keeps it at 4.

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 core sentence is dense but front-loaded: scope, binding behavior, write effect, and return value in one pass, with the period-window default following. The closing fragment 'Decoding mode, 6 patterns (EqualTo, RollUp, ...)' is ungrammatical and its relevance is unclear, which is the only real waste.

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 mutation tool with no output schema, the definition covers what is written, how variables bind, what is returned, and the default fact-selection window — enough for an agent to call it correctly. Missing are the decoding-mode concept's actual meaning (introduced but never explained) and any note on the cost or irreversibility of writing a row per rule.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents every parameter, and the baseline is 3. The description reinforces the period-window default ('most recent in_scope fact ... regardless of period') but adds no syntax, format, or interaction detail beyond what the schema's own descriptions state, and the trailing 'Decoding mode, 6 patterns' fragment is not tied to any parameter.

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 names a specific verb and resource ('Runs every rule targeting the given structure') and precisely delimits scope: structure-scoped rules plus element- and association-scoped rules for the structure's atoms. It also states the side effect (one VerificationResult row per rule) and the return shape (results plus status-keyed summary). It stops short of differentiating itself from plausible neighbors like assert-metrics or compute-metrics, so a 4 rather than a 5.

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?

Usage is implied by the scope statement — call it when you want all rules bound to a structure evaluated — and the period-window note hints at when to pass period_start/period_end. There is no explicit when-to-use/when-not-to-use guidance and no named alternative for the adjacent 'compute' or 'assert' style tools, leaving selection partly to inference.

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.