Skip to main content
Glama

Get requirement

get_req

Read and parse a requirement document by ID, returning full frontmatter and body, or its raw body text with optional line windowing and numbering.

Instructions

Read, parse, and return a full requirement document (frontmatter and body) by its id. Pass raw=True to return the frontmatter-stripped body text verbatim instead. With raw=True, optional read-style offset/limit window the raw read: offset (1-based, default 1) is the first body line to return, limit (line count, default through end of body) how many; out-of-range values clamp (offset > N returns the empty string), and coordinates with raw=False raise ValueError. A document that exists but fails to parse returns a ParseFailureResult (error/path/id) instead of raising; its error text is byte-identical to the domain's own list tool's failed-row error for the same file (identical field path and cause, including the trailing pydantic documentation line; ADR 9080b37c-82b3-4f63-81f1-79641d0bf14c). An invalid id (path-injection attempt or wrong format) is also a ValueError, raised before any file access. With raw=True, an optional numbered=True prefixes every returned body line with its 1-based absolute body-line number in the "<n>: " form (plain decimal, no padding) -- under offset/limit windowing the numbers start at the clamped offset and never restart at 1, so a number seen in the output can be fed straight back into the generic update tool's offset. numbered is meaningful only with raw=True: combining it with raw=False raises ValueError (like offset/limit), and a numbered read of a document that fails to parse returns the ParseFailureResult described above, never numbered text. Numbered output must never be fed back verbatim into content for update or create_req -- strip the "<n>: " prefix from each line first (it is likewise never a valid edit old_str). The optional language parameter (default 'en') selects the language variant to read: omitted/'en' = the flat docs/req/ document, exactly the default behavior; any other ISO 639-1-shaped lowercase two-letter code (e.g. 'de') = that language's variant at docs/req/{language}/ (the EN source's exact basename). The language is shape-validated before any file access (a path-injection-shaped payload is a ValueError, like an invalid id), and a shape-valid language without a packaged heading-mapping table is rejected up front with an actionable ValueError, also before any file access. A raw=True read of a variant returns the variant's on-disk body verbatim (translation preserved); a raw=False read parses it through the variant's heading table, so the structured model holds canonical heading text. The ParseFailureResult error of a broken variant is byte-identical to list_req(language=...)'s failed row for the same file.

Input Schema

NameRequiredDescriptionDefault
idYes
rawNo
limitNo
offsetNo
languageNoen
numberedNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.38.0
    • addedInput schema / properties / language
      Added value: +{
      +  "default": "en",
      +  "title": "Language",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.37.0
    • changedOutput schema / $defs / Level / properties / value / description
      Previous value: -"Single-line value giving the requirement's obligation strength (e.g. \"MUST\")."New value: +"Single-line value giving the requirement's obligation strength (e.g. \"MUST\"). One of `MUST`, `SHOULD`, `MUST NOT`, `SHOULD NOT`, `MAY` (RFC 2119)."
    • addedOutput schema / $defs / ReqFrontmatter / properties / status / enum
      Added value: +[
      +  "accepted",
      +  "deprecated",
      +  "draft",
      +  "implemented",
      +  "proposed",
      +  "rejected",
      +  "superseded"
      +]
  3. First observedv0.36.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: parse failures return a ParseFailureResult rather than raising, invalid ids and path-injection payloads raise ValueError before file access, out-of-range offsets clamp to empty string, and coordinate/language-table rejections are specified. These are exactly the behavioral traits an agent needs to avoid broken call sequences.

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

Conciseness3/5

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

Purpose is front-loaded, but the text is an undifferentiated block well past what the tool needs: the ParseFailureResult/byte-identical-to-list_req claim is restated twice (once with an ADR UUID), and the numbered-output warning is repeated for update, create_req, and edit in successive clauses. Structure is dense run-on rather than layered, which raises the cost of extracting the offset/limit and language rules.

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?

Six parameters, no annotations, an output schema that carries the return shape. The description covers the non-obvious interactions (raw×offset/limit×numbered, language×raw parse behavior, error parity with list_req) that no structured field expresses. Only the valid `id` format is left unstated, a minor omission given the output schema handles returns.

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 coverage is 0%, so the description must compensate and largely does: raw, offset (1-based default 1), limit (default through end), numbered ("<n>: " prefix, absolute numbering under windowing), and language (default 'en', ISO 639-1 shape, heading-table requirement) are all given meaning beyond their names. The `id` parameter is only described by validation failure mode ('wrong format') without stating the expected id shape, which is the one semantic left thin.

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?

Opens with a specific verb+resource: 'Read, parse, and return a full requirement document (frontmatter and body) by its id', then immediately contrasts the raw=True variant ('frontmatter-stripped body text verbatim'). This distinguishes get_req from list_req/parse_req/update, which are named later in the text.

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?

Gives concrete selection rules for the option variants: raw=True for verbatim bodies, offset/limit only with raw=True, language for translation variants, numbered only with raw=True. It also routes the agent away from misuses (numbered text into update/create_req/edit). It does not explicitly state when to prefer get_req over list_req or parse_req, which is the remaining gap.

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

Deploy Server

Other Tools