Skip to main content
Glama

cognitive.counterfactual_what_if

Counterfactual engine: evaluate 'What if I had done X instead of Y at step t?' using Pearl's abduction-intervention-prediction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dtNo
factual_traceYes
intervention_stepYes
counterfactual_actionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states that it uses Pearl's abduction-intervention-prediction, which implies a three-step internal process (abduct, intervene, predict) and that it requires a causal model (via factual_trace), but it does not disclose potential limitations, such as the need for a fitted causal model, computational costs, or what happens if the intervention step is out of bounds. It adds some behavioral context beyond a simple 'computes counterfactuals' but leaves gaps.

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, concise sentence that front-loads the purpose ('Counterfactual engine') and the key evaluation question. It is efficient and avoids redundancy. It loses a point because it uses a colon and then the phrase 'using Pearl's...' which, while informative, could be seen as slightly technical and may be superfluous for some agents, but overall it is well-structured and to the point.

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

Completeness3/5

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

Given the tool's complexity (requires a causal model, three-step procedure) and the absence of annotations, the description is adequate but not thorough. The presence of an output schema (not shown in detail but indicated by Has output schema: true) means the return value is documented elsewhere. However, it does not mention the need for a prior fitted causal model or the assumptions underlying Pearl's framework, which are critical for correct invocation. The description is complete enough for a high-level understanding but lacks operational details.

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

Parameters2/5

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

Schema description coverage is 0%, and the description does not mention any parameters by name. The description gives a high-level idea of inputs (factual_trace, intervention_step, counterfactual_action) but does not elaborate on their structure or semantics beyond what the schema provides. For instance, it doesn't explain that intervention_step must be a valid index within the factual_trace, or how counterfactual_action as a string is interpreted. The description fails to compensate for the lack of schema documentation.

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 clearly states it is a counterfactual engine for evaluating 'What if I had done X instead of Y at step t?' using Pearl's abduction-intervention-prediction. It names the specific verb 'evaluate' and the resource (counterfactual scenarios), and the method is specified. It distinguishes from siblings like cognitive.predict_world_state and cognitive.simulate_actions by focusing on counterfactual reasoning, though it does not explicitly name those alternatives.

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?

The description implies when to use the tool: when you need to ask hypothetical counterfactual questions about past steps in a causal model. However, it does not explicitly state when not to use it or name sibling alternatives, such as cognitive.predict_world_state for forward simulation or cognitive.simulate_actions for exploring action outcomes without the causal framework. The context is clear but lacks explicit exclusions.

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