Skip to main content
Glama

Parse decision

parse_dec

Parse decision markdown files with YAML frontmatter and body from disk into structured decision documents; malformed files return validation errors, while missing or unreadable paths raise file-access errors.

Instructions

Parse a decision markdown file (YAML frontmatter + body) from disk into a structured :class:~biz.dfch.specmgr.dec.models.v1.DecDocument. 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

A4/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 richly: it discloses that parse failures return a non-raising ValidateResult with a 300-char error cap instead of raising exceptions, that missing files still raise OSError-family errors, and cites ADR and issue references. This is exceptionally transparent for a parser.

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 description is a single, information-dense sentence that front-loads the purpose and then adds important behavioral details. It is slightly long and parenthetical, but every clause adds useful context and there is no filler.

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?

Given a simple one-parameter parser tool with an output schema already describing the return type, the description covers the key behavioral edge cases (parse failure vs. missing file) and result shape. Nothing essential for correct invocation is missing.

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?

There is only one parameter (`path`) and the schema description coverage is 0%, meaning the schema provides no explanatory text. The description states that parsing is from disk and references `Path.read_text()`, which implies `path` is a filesystem path, but it does not explicitly define the parameter's meaning or format beyond that. With only one simple parameter, this is adequate but not maximal.

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 (Parse) and resource (decision markdown file), and describes exactly what the file is composed of (YAML frontmatter + body) and the output type (DecDocument). It is clearly distinguishable from siblings like parse_tsk or parse_gol by naming the dec document model.

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 does not explain when to use parse_dec versus alternatives like get_dec or list_dec; it only describes the parsing behavior. An agent could infer that this tool loads from disk, but there is no explicit guidance on when this is preferable to other dec-reading tools.

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