Skip to main content
Glama

add_constraint

Record a project constraint or an explicit non-goal that applies to tasks in a project. Use it for rules a single task's spec cannot carry: 'one deployable service', 'no new third-party APIs', 'must stay under 50KB on the client', or a non-goal like 'do not add a mobile app'. Constraints are returned by get_next_task on every task they apply to. Returns the new constraint's id, kind, text and node scope.

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": {
      "project_id": "<project_id>",
      "kind": "<kind>",
      "text": "<text>"
    },
    "name": "add_constraint"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes'constraint' for a rule the build must obey; 'non_goal' for something this project explicitly will not do.
textYesThe rule in one clear sentence, e.g. 'Ship a single deployable service — do not introduce a second deploy target.'
project_idYesThe project ID.
applies_to_node_idsNoScope the rule to specific node IDs (and, transitively, to every task that depends on them). Omit, or pass null, to apply it to every task in the project; pass [] to apply it to no task.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare a non-destructive write, and the description adds genuinely non-obvious behavior: constraints propagate to get_next_task on every task they apply to, and the call returns id, kind, text and node scope. It does not address that duplicate identical calls create duplicates (idempotentHint=false), a minor remaining gap.

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

Conciseness5/5

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

Purpose is front-loaded in the first clause, followed by usage rationale, examples, propagation behavior and return shape in four tight sentences. No filler or repetition of schema details.

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 4-parameter mutation with no output schema, the description covers purpose, selection criteria, downstream effects and return shape, which is nearly everything an agent needs. The only omission is duplicate-call behavior, consistent with the idempotentHint=false annotation.

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 kind, text, project_id and applies_to_node_ids are already fully documented (including the [] vs. null scoping distinction). The description adds only the phrase 'node scope' in the return values, which does not meaningfully extend parameter meaning.

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 names a specific verb ('Record') and resource ('project constraint or an explicit non-goal'), then scopes it to tasks in a project. Concrete example rules ('one deployable service', 'do not add a mobile app') make the resource unambiguous and separate it from remove_constraint/list_constraints.

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?

It gives a clear selection rule: use this for rules a single task's spec cannot carry, which tells the agent when project-level scope is warranted. It stops short of naming alternatives such as list_constraints or remove_constraint, so exclusions are implied rather than stated.

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.