Skip to main content
Glama

Parse requirement

parse_req

Parse a requirement Markdown file with YAML frontmatter and body into a structured ReqDocument; invalid existing files return a non-raising ValidateResult instead of throwing.

Instructions

Parse a requirement markdown file (YAML frontmatter + body) from disk into a structured :class:~biz.dfch.specmgr.req.models.v1.ReqDocument. An existing file that fails to parse returns a non-raising ValidateResult (valid=False, a single errors[].message capped at 300 chars as the generic validate tool caps it, feat-110) instead of raising AssertionError/pydantic.ValidationError/yaml.YAMLError (ADR f14f125e-eaad-4f4f-a6fd-3c931bed726e, GitHub issue #204 -- case 5 of the ADR 519d1206 non-raising-structured-result workaround chain); a truly-absent or unreadable path still raises the OSError-family file-access error (FileNotFoundError/PermissionError/OSError) from Path.read_text().

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.36.0

TDQS

B3.4/5.0
Behavior4/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 well: it discloses that a parse failure yields a non-raising ValidateResult (valid=False, 300-char capped message) rather than an exception, while an absent/unreadable path still raises the OSError family. This is exactly the kind of error-contract detail an agent needs; only the read-only/no-side-effect nature is left implicit.

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 second sentence is an enormous run-on salted with internal traceability noise (ADR UUIDs, GitHub issue #204, 'case 5 of the ADR 519d1206 non-raising-structured-result workaround chain') that adds no value for an agent selecting or invoking the tool.

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?

An output schema exists, so return values need not be re-explained, and the description thoroughly covers the success and failure semantics. The remaining gap is tool-selection context against get_req/validate, which is the only thing missing for a one-parameter parse tool.

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 coverage is 0% and the single 'path' parameter is undocumented in the schema. The description adds meaning by implying the path targets a markdown file on disk and by specifying that unreadable paths raise file-access errors, but it omits path format constraints (relative/absolute, extension requirements).

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?

States a specific verb (parse) and resource (requirement markdown file with YAML frontmatter + body) and names the exact output type (ReqDocument). It does not, however, differentiate itself from the many sibling retrieval tools such as get_req, list_req, or validate, so an agent must infer which one applies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description never states when to use this tool versus get_req, create_req, or validate, nor any precondition for calling it. It describes error outcomes but gives no routing guidance, leaving the agent to guess from the name alone.

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