Skip to main content
Glama

Parse risk

parse_rsk

Parses a risk markdown file into a structured RskDocument. Returns a validation result for parse errors, but raises for file access issues.

Instructions

Parse a risk markdown file (YAML frontmatter + body) from disk into a structured :class:~biz.dfch.specmgr.rsk.models.v1.RskDocument. 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 so well: it discloses the non-raising ValidateResult on parse failure (valid=False, error message capped at 300 chars) and that missing/unreadable paths still raise OSError-family errors. What it omits is that this is a read-only, side-effect-free operation, and nothing about permissions.

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?

The core behavior is front-loaded in the first clause and the error-handling detail is genuinely useful, but ADR hashes, GitHub issue numbers, 'feat-110' and a fully-qualified class path are noise that inflates a one-sentence contract into a dense paragraph.

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 shapes need no explanation, yet the description usefully adds the non-standard non-raising failure contract that the schema alone would not reveal. The remaining gap is the path parameter's expected form, which neither schema nor description pins down.

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% with a single parameter, so the description must compensate; 'from disk' plus the reference to Path.read_text() does convey that path is a filesystem path, not an ID or slug. However it does not state relative-vs-absolute expectations or the expected filename/extension, leaving the schema's bare 'path: string' only partially clarified.

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 concrete verb (Parse) and resource (a risk markdown file, YAML frontmatter + body) and names the resulting type, RskDocument. It does not explicitly differentiate itself from the many sibling parsers (parse_tsk, parse_gol, etc.), but the resource binding is specific enough that an agent can distinguish risk-parsing from the other parse_* tools.

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 explains failure semantics in depth but never states when to call this tool versus get_rsk, list_rsk or create_rsk, nor any prerequisite (e.g. file must already exist on disk). Usage must be inferred from 'from disk'.

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