Skip to main content
Glama

constraints

Read-only

Retrieve active project rules that match a file before editing to surface relevant guidance and warnings without blocking changes.

Instructions

Active constraints whose files match a file. Warns before editing; never blocks.

Returns JSON {"file", "constraints": [{"path", "title", "priority", "body"}]}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "constraints"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoFile being edited: absolute or relative to the project. Empty (with no relative_path) returns an empty result.
projectNoProject; defaults to --project.
hook_eventNoOnly for Claude Code hooks: ${hook_event_name}. Omit otherwise.
project_dirNoAbsolute project directory (hooks pass ${cwd}); used to relativize file.
relative_pathNoSerena edits pass relative_path instead of file; used when file is empty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.16.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and the description is consistent with that, adding genuine behavioral context: the result is advisory only and never blocks an edit. It also discloses the exact return shape (file plus constraint objects with path/title/priority/body), which is valuable given there is no output schema; it stops short of saying what happens when multiple projects or paths are supplied.

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?

Two short sentences, front-loaded with the subject and a tight behavioral clause, then the return shape. The phrasing "whose files match a file" is slightly circular but nothing is wasted.

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 five-parameter, read-only lookup with fully documented parameters and no output schema, the definition covers purpose, non-blocking behavior, and return structure well. The remaining gap is that the interaction between project, project_dir, and relative_path is left entirely to the schema, but that is reasonable given 100% coverage.

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 every parameter already carries its own explanation, including the tricky file/relative_path fallback and the hook event fields. The description contributes only the loose notion of 'matching a file' and adds no routing or precedence guidance beyond the schema, so baseline 3 applies.

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 resource (active constraints) plus a selection rule (whose files match the given file), which is far more than a restatement of the name. It doesn't explicitly contrast itself with any named sibling, but no sibling in the list obviously overlaps, so disambiguation is largely implicit.

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?

"Warns before editing; never blocks" implies the intended call site is a pre-edit check, so usage is inferable rather than stated. There is no explicit when-not-to-use clause and no mention of when to prefer a sibling such as review or context instead.

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