Skip to main content
Glama

Parse risk

parse_rsk

Parses a risk Markdown file with YAML frontmatter and body into a structured RskDocument; parse failures return a non-raising validation result, while missing paths raise file-access errors.

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(). The file's language is derived from its path position relative to the risk base directory: a file in the flat docs/rsk/ directory parses canonical (no heading-mapping table); a file in a direct two-letter docs/rsk/{language}/ subdirectory parses through that language's table (an actionable ValueError when no table exists for the language); any other location parses canonical.

Input Schema

NameRequiredDescriptionDefault
pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.37.0
    • addedOutput schema / $defs / Impact / pattern
      Added value: +"^Impact [1-5]$"
    • addedOutput schema / $defs / Probability / pattern
      Added value: +"^Probability [1-5]$"
    • addedOutput schema / $defs / RskFrontmatter / properties / status / enum
      Added value: +[
      +  "accepted",
      +  "closed",
      +  "dropped",
      +  "mitigating",
      +  "occurred",
      +  "open"
      +]
  2. First observedv0.36.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it specifies the successful return type, the non-raising ValidateResult on an existing unparseable file, the 300-character error message cap, and the OSError-family exceptions for absent or unreadable paths. It also discloses the ValueError case when a language table is missing.

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 purpose is front-loaded, but the description is a dense single paragraph with internal ADR UUIDs, issue numbers, feat IDs, and long exception lists that are not all necessary for an agent to invoke the tool. The behavioral detail earns some space, but the structure could be tighter and more scannable.

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?

Given the one-parameter schema and the presence of an output schema, the description is largely complete: it covers successful parsing, parse-failure result behavior, file-access exceptions, and language routing. Only minor path syntax details are left implicit.

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 description coverage is 0%, so the description must explain the single path parameter, and it adds meaningful path-position semantics: flat docs/rsk parses canonical, docs/rsk/{language} uses that language's table, and other locations parse canonical. It does not fully specify relative versus absolute paths or file extension expectations, so it stops short of complete parameter coverage.

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?

States a specific verb, resource, and output: parse a risk markdown file with YAML frontmatter and body from disk into a structured RskDocument. The phrasing distinguishes parsing from retrieval/listing siblings such as get_rsk and list_rsk, even though it does not name those siblings directly.

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

Usage Guidelines3/5

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

The description implies usage by saying it parses a risk markdown file from disk, but it never explicitly says when to choose parse_rsk over get_rsk, list_rsk, or other parse_* tools, nor when not to use it. Error behavior is described, but that is not routing guidance.

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