Skip to main content
Glama

csp_backtracking

Solve constraint satisfaction problems through backtracking search with configurable variable and value ordering plus inference options such as forward checking and MAC.

Instructions

Backtracking search for a CSP. constraints: [[X, op, Y]] with op in != == < > <= >=; or neighbours {X: [Y, ...]} meaning X != Y (map colouring). variable_order: static | mrv. value_order: static | lcv. inference: none | forward_checking | mac.

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": {
      "variables": "<variables>",
      "domains": "<domains>"
    },
    "name": "csp_backtracking"
  }
}

Input Schema

NameRequiredDescriptionDefault
domainsYes
inferenceNoforward_checking
variablesYes
neighboursNo
constraintsNo
value_orderNolcv
variable_orderNomrv

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does explain the core search strategy plus the available ordering and inference modes. However, it does not clarify whether the tool returns the first solution or all solutions, how failure is reported, or what the inference modes practically imply, leaving noticeable gaps for a complex solver.

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 compact and front-loads the core purpose before parameter details. The telegraphic semicolon style is efficient but sometimes dense, especially around optional constraints and neighbours, so it stops short of ideal clarity.

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?

For a complex CSP solver with seven parameters and no annotations, the definition gives useful parameter semantics and an output schema exists to cover return values. Still, it omits tool-selection guidance and does not describe the required variables and domains parameters or failure behavior, so the overall context is only minimally adequate.

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 description coverage is 0%, so the description must compensate for the seven undocumented parameters. It substantially does so by giving concrete formats for constraints and neighbours and by listing valid options for variable_order, value_order, and inference; only variables and domains remain unexplained, though their meanings are comparatively intuitive.

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 a specific algorithm and resource: backtracking search for a CSP. It does not explicitly distinguish this tool from siblings such as csp_ac3 or walksat_run, so it falls short of the sibling-routing clarity expected at the top score.

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

Usage Guidelines2/5

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

The description gives no when-to-use guidance, prerequisites, or comparison to alternative CSP tools. At best, the phrase 'Backtracking search for a CSP' implies the broad use case, but an agent receives no criteria for choosing this tool over csp_ac3, walksat_run, or other siblings.

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