Skip to main content
Glama

context_get_rules

Read-only

Retrieve repository coding rules and conventions. Returns all rules for a repository, or a specific rule by ID. Rules are extracted from CLAUDE.md, AGENTS.md, .cursorrules, CONTRIBUTING.md, and other convention files in the repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskNoOptional task filter: code-review, code-generation, or code-questions
pathsNoOptional repo-relative file paths to scope rules to, one per line. A rule extracted from <dir>/CLAUDE.md (or similar) is returned only when at least one path is inside <dir>/. Rules from repo-root convention files always apply. Pass the files being reviewed, generated, or asked about. Omit for repo-wide.
rule_idNoOptional rule ID to retrieve a specific rule
languageNoOptional language filter (e.g., 'kotlin', 'python', 'typescript')
repo_nameYesRepository to retrieve rules for. Use 'owner/repo' form (e.g. 'unblocked/unblocked').

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is known. The description adds useful behavioral context about extraction sources (CLAUDE.md, AGENTS.md, etc.) and the all-or-specific return behavior, but it does not disclose edge cases such as empty results or behavior when no rule matches.

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?

The description is three sentences with no filler. It front-loads the core purpose, then explains return modes and sources, making every sentence useful.

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?

The presence of a full input schema, output schema, and safety annotations covers much of the operational detail. The description provides the source context and return modes, making the tool sufficiently complete for an agent to select and invoke it, though it could explicitly differentiate from sibling retrieval tools.

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 the schema already documents all parameters thoroughly. The description adds minimal semantic value, only loosely echoing the 'specific rule by ID' concept already present in the rule_id parameter description.

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 states a specific verb ('Retrieve') and a distinct resource ('repository coding rules and conventions'), and clearly distinguishes this tool from sibling tools like context_get_urls by focusing on rules extracted from convention files. It also specifies the two main modes: all rules or a specific rule by ID.

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?

The description makes it clear the tool is for retrieving repository coding rules and conventions, and the parameter details explain optional filters and path scoping. It does not explicitly name alternatives or state when not to use this tool, but the intended context is strongly implied.

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.