Skip to main content
Glama

what_if

Read-onlyIdempotent

Apply hypothetical fact modifications to a knowledge base and compare query results before and after, without committing changes.

Instructions

Apply hypothetical fact changes and compare the query before and after.

Use this to test a change without committing to it: promoting a user to a role, adding a resource, revoking an assignment. modifications is one change per line, + fact(...) to add or - fact(...) to remove. Only facts can be changed, not rules. A - line that matches no existing fact is an error, so a typo cannot silently produce a misleading comparison.

Returns WhatIfResult:

  • ok (bool): false when the request could not be evaluated.

  • before_count, after_count (int): solution counts on each knowledge base.

  • delta (int): after_count - before_count.

  • solutions_before, solutions_after (list): full solutions with proofs.

  • applied (list of str): the modifications as applied, normalized.

  • conclusion (str): a readable description of the impact.

  • error (str | null): a readable message when ok is false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesFalse when the request could not be evaluated.
deltaNoafter_count - before_count.
errorNoReadable, actionable message when ok is False.
appliedNoModifications that were applied, normalized.
conclusionNoHuman-readable description of the impact.
after_countNoSolutions on the modified knowledge base.
before_countNoSolutions on the base knowledge base.
solutions_afterNo
solutions_beforeNo
Behavior5/5

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

The description reveals detailed behavior beyond annotations: it returns a `WhatIfResult` with fields like `ok`, `before_count`, `after_count`, `delta`, `solutions_before`, `solutions_after`, `applied`, `conclusion`, and `error`. It confirms the tool is read-only (readOnlyHint=true), idempotent, and non-destructive, and adds that only facts can be mutated.

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 moderately long but well-organized. It begins with the core purpose, then usage instructions, modification format, and finally a full list of return fields. Each section adds value without redundancy. Minor improvement: the return fields could be more compact, but overall it is efficient.

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?

The description is complete for a complex tool with 5 parameters (all with 0% schema coverage) and an output schema. It covers input syntax, error conditions, and all return fields. There are no gaps; the agent can use this tool correctly based solely on the description.

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?

Although the input schema has 0% description coverage, the description compensates fully. It explains the `modifications` syntax (`+ fact(...)` / `- fact(...)`), the `query` format (Euclid-IR body syntax), and the `base_knowledge` format (text or YAML with facts, rules, queries). It also notes that variables start with `$`, `_` is a wildcard, and `NOT` is closed-world negation.

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 clear action: 'Apply hypothetical fact changes and compare the query before and after.' It explains the tool's value (test without committing) and gives concrete examples (promoting a user, adding a resource, revoking an assignment). The purpose is distinct from sibling tools like 'reason' and 'diagnose' which focus on non-hypothetical reasoning.

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 explicitly states when to use the tool ('test a change without committing to it') and provides examples. It also clarifies limitations ('Only facts can be changed, not rules') and warns about errors ('A `-` line that matches no existing fact is an error'). Although alternatives are not named, the usage context is clear and well-documented.

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

Install Server

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/snegi26/euclidMCPPaper'

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