constraints
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
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | File being edited: absolute or relative to the project. Empty (with no relative_path) returns an empty result. | |
| project | No | Project; defaults to --project. | |
| hook_event | No | Only for Claude Code hooks: ${hook_event_name}. Omit otherwise. | |
| project_dir | No | Absolute project directory (hooks pass ${cwd}); used to relativize file. | |
| relative_path | No | Serena edits pass relative_path instead of file; used when file is empty. |