Skip to main content
Glama

Parse task list

parse_tsk

Parses a task list Markdown file with YAML frontmatter and body into a structured TskDocument, returning a non-raising validation result when an existing file is malformed.

Instructions

Parse a task list markdown file (YAML frontmatter + body) from disk into a structured :class:~biz.dfch.specmgr.tsk.models.v1.TskDocument. 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 task list base directory: a file in the flat docs/tsk/ directory parses canonical (no heading-mapping table); a file in a direct two-letter docs/tsk/{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. Changed4 schema fields changedv0.37.0
    • changedOutput schema / $defs / RecentUpdates / description
      Previous value: -"`## Recent Updates` -- a dynamic, newest-first list of timestamp-led `### ` update entries.\n\nA fixed-title (non-alias) `MarkdownSection2WithComment`, structurally\nsimilar to `AdrBody`'s `## Pros and Cons of the Options`/`AdrOption`\ncollection, but with no dedicated per-entry tools (no\n`option_create`/`option_list` equivalent) -- entries are prepended\n(newest-first) by editing the whole body. May be preceded by an\nexplanatory HTML comment (e.g. an ordering hint).\n\nParameters\n----------\ncomment:\n    Optional explanatory HTML comment (`<!-- ... -->`), e.g.\n    `<!-- Newest entry first -- prepend new entries directly below\n    this comment. -->`. Inherited from `MarkdownSection2WithComment`.\nupdates:\n    The dynamic collection of `### ` entries, in document order,\n    newest-first (enforced, see `_validate_newest_first`). Requires\n    at least one entry (``min_length=1``), same as `Task.items` below --\n    `models.md`'s generic list-parsing engine already enforces this\n    during `from_text` for any non-`Optional` `list[X]` field regardless\n    of `min_length`, so this constraint makes direct Python construction\n    (e.g. a future `create_tsk` tool) consistent with parsing instead of\n    silently allowing `RecentUpdates(updates=[])`. A newly created `tsk`\n    document must therefore seed a first entry (e.g. \"Created\") -- see\n    the feature README's Decisions Made."New value: +"`## Recent Updates` -- a dynamic, newest-first list of timestamp-led `### ` update entries.\n\nA fixed-title (non-alias) `MarkdownSection2WithComment`, structurally\nsimilar to `AdrBody`'s `## Pros and Cons of the Options`/`AdrOption`\ncollection, but with no dedicated per-entry tools (no\n`option_create`/`option_list` equivalent) -- entries are prepended\n(newest-first) by editing the whole body. May be preceded by an\nexplanatory HTML comment (e.g. an ordering hint).\n\nParameters\n----------\ncomment:\n    Optional explanatory HTML comment (`<!-- ... -->`), e.g.\n    `<!-- Newest entry first -- prepend new entries directly below\n    this comment. -->`. Inherited from `MarkdownSection2WithComment`.\nupdates:\n    The dynamic collection of `### ` entries, in document order,\n    newest-first (enforced, see `_validate_newest_first`). Requires\n    at least one entry (``min_length=1``), same as `Task.items` below --\n    `models.md`'s generic list-parsing engine already enforces this\n    during `from_text` for any non-`Optional` `list[X]` field regardless\n    of `min_length`, so this constraint makes direct Python construction\n    (e.g. the `create_tsk` tool) consistent with parsing instead of\n    silently allowing `RecentUpdates(updates=[])`. A newly created `tsk`\n    document must therefore seed a first entry (e.g. \"Created\") -- see\n    the feature README's Decisions Made."
    • addedOutput schema / $defs / TaskItem / pattern
      Added value: +"^\\[( |x|X)\\]\\s*(.*)$"
    • addedOutput schema / $defs / TskFrontmatter / properties / status / enum
      Added value: +[
      +  "active",
      +  "cancelled",
      +  "done",
      +  "draft"
      +]
    • addedOutput schema / $defs / UpdateEntry / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}\\.\\d{3}(?:Z|[+-]\\d{2}:\\d{2})(?: - | : ).+$"
  2. First observedv0.36.0

TDQS

A3.9/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 burden and does so thoroughly: parse failures on existing files return a non-raising ValidateResult (valid=False, single 300-char error message), while absent/unreadable paths still raise OSError-family errors from Path.read_text(). It also discloses the language-table resolution behavior and the ValueError case for a missing language table.

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?

Core purpose is front-loaded, which is good, but the text is a single dense paragraph salted with ADR UUIDs, GitHub issue numbers, and feat IDs that add little for an agent choosing or calling the tool. The useful behavioral facts are buried inside long parentheticals.

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 shape needn't be spelled out, and the description still covers error paths and language resolution well. The main remaining gap is that the 'task list base directory' is never defined or tied to a configuration mechanism, which an agent would need to interpret the path argument confidently.

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 coverage is 0% and the single 'path' parameter has no description, but the description compensates by explaining how path position determines parsing behavior: flat docs/tsk/ parses canonical, docs/tsk/{language}/ uses that language's table, and any other location parses canonical. It leaves open whether the path is absolute or relative to the base directory.

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 task list markdown file ... into a structured TskDocument'), which distinguishes it from the many sibling parse_* tools by resource type. It never explicitly contrasts itself with get_tsk or validate, so sibling differentiation is implied rather than stated.

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 makes clear this is for reading an on-disk markdown file, and the error-behavior discussion implies when a parse failure surfaces as a ValidateResult rather than an exception. However, it never says when to choose this over alternatives like get_tsk, list_tsk, or validate, nor does it state prerequisites.

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