Skip to main content
Glama

Parse problem statement

parse_prb

Parses a problem statement Markdown file with YAML frontmatter into a structured PRB document and returns validation errors for malformed existing files without raising.

Instructions

Parse a problem statement markdown file (YAML frontmatter + body) from disk into a structured :class:~biz.dfch.specmgr.prb.models.v1.PrbDocument. 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 problem statement base directory: a file in the flat docs/prb/ directory parses canonical (no heading-mapping table); a file in a direct two-letter docs/prb/{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. Changed2 schema fields changedv0.37.0
    • addedOutput schema / $defs / Prb / properties / problem_statement / pattern
      Added value: +"^(?:.+)\\s+is\\s+causing\\s+(?:.+),\\s+for\\s+(?:.+)\\s+because\\s+(?:.+)\\.$"
    • addedOutput schema / $defs / PrbFrontmatter / properties / status / enum
      Added value: +[
      +  "active",
      +  "cancelled",
      +  "draft",
      +  "resolved"
      +]
  2. First observedv0.36.0

TDQS

A4.1/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 behavioral burden and does so thoroughly: parse failures return a non-raising ValidateResult with valid=False and a 300-char error message, absent/unreadable paths still raise the OSError family from Path.read_text(), and a missing language table yields an actionable ValueError. This is far more than the schema conveys.

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

Conciseness4/5

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

The failure-mode contrast is front-loaded and information-dense, but internal references (feat-110, ADR UUIDs, issue #204, 'case 5 of the ... workaround chain') add noise an agent cannot act on. Removing that parenthetical would improve it without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter parse tool with an output schema present, the description covers what is parsed, what is returned on success and failure, which exceptions propagate, and how path layout changes parsing. Nothing an agent needs to invoke it correctly is missing.

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?

The single 'path' parameter has no schema description (0% coverage), and the description compensates well by explaining that the path's position relative to the problem statement base directory determines the language and heading-mapping behavior (flat docs/prb/ vs docs/prb/{language}/ vs anywhere else).

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 and resource: parse a problem statement markdown file (YAML frontmatter + body) from disk into a PrbDocument. This clearly separates it from get_prb/list_prb/create_prb, though it never names those siblings explicitly.

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?

Usage is implied by 'from disk' versus the get_/list_ siblings, but there is no explicit statement of when to call this instead of get_prb or the generic validate tool. No exclusions or preconditions are given for the success path, only for failure modes.

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