Skip to main content
Glama

Create decision

create_dec

Create a new decision record from validated body content: assign a fresh ID, derive the filename from the H1 title, write it to the decision directory, or create a translation using an existing ID.

Instructions

Create a new decision: assigns a fresh id, derives a filename from the body's H1 title, validates the submitted body-only content, and writes the new document to the decision base directory. A content-validation failure of the submitted body 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 (ADR f14f125e-eaad-4f4f-a6fd-3c931bed726e, GitHub issue #204 -- case 5 of the ADR 519d1206 non-raising-structured-result workaround chain); nothing is written in that case. The structure reference is the get_dec_schema tool (the generated JSON Schema); the get_dec_template/get_dec_example tools return the authoring template and a complete sample. Returns the newly created document's frontmatter only (no body); use the corresponding get_dec tool to fetch the full document afterward. The optional language parameter (default 'en', feat-197-i18n) selects the language to create the document in: omitted/'en' = a new flat docs/dec/ document with a fresh id, exactly the default behavior (id must then be omitted); a non-default ISO 639-1-shaped lowercase two-letter code (e.g. 'de') creates a TRANSLATION of an existing decision instead: id -- the shared id of the existing EN source document -- is then required (no fresh id is assigned; the variant carries the same id), the EN source must exist (else DecNotFoundError), and the variant is written to docs/dec/{language}/ under the EN source's exact file name with status draft; content is validated through that language's heading-mapping table (translated headings are accepted) and persisted verbatim. An existing variant of that id and language is never overwritten (FileExistsError). A malformed language, one with no packaged heading-mapping table, a missing id for a non-default language, or an id given for the default language is a ValueError raised before any file access.

Input Schema

NameRequiredDescriptionDefault
idNo
contentYes
languageNoen

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.38.0
    • addedInput schema / properties / id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Id"
      +}
    • addedInput schema / properties / language
      Added value: +{
      +  "default": "en",
      +  "title": "Language",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.37.0
    • addedOutput schema / $defs / DecFrontmatter / properties / status / enum
      Added value: +[
      +  "accepted",
      +  "deprecated",
      +  "draft",
      +  "proposed",
      +  "rejected",
      +  "superseded"
      +]
  3. First observedv0.36.0

TDQS

A4.7/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: content-validation failure yields a non-raising ValidateResult with valid=False and a 300-char-capped errors[].message, nothing is written in that case, and it discloses FileExistsError on existing variants, DecNotFoundError for a missing source, and ValueError for malformed language/missing id/extra id before any file access. It also states precisely what is persisted (content verbatim) and that variants start as status draft.

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 opening sentence is front-loaded and efficient, but the body is one dense paragraph laced with internal traceability noise ('feat-110', 'ADR f14f125e-...', 'GitHub issue #204 -- case 5 of the ADR 519d1206 ... chain') that gives an agent no actionable signal. The information is valuable but the structure would be far more usable as short labeled sections for the two modes and the error cases.

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 values need not be explained, and the description still usefully notes that only frontmatter is returned and points to get_dec for the body. Modes, id/language interaction, error types, and write targets are all covered; the only shortfall is that the dense prose structure makes the completeness harder to extract than it should be.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does for all three parameters: content is the body-only validated content whose H1 supplies the filename; id is optional-null for the default language (must be omitted) but required for a translation and must match the existing EN source id; language defaults to 'en' and must be a lowercase ISO 639-1-shaped two-letter code with a packaged heading-mapping table. This goes well beyond the bare schema types.

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?

Opens with a specific verb+resource ('Create a new decision') and enumerates the concrete effects: fresh id, filename derived from the body's H1 title, validation, write to the decision base directory. It also distinguishes the two operating modes (flat docs/dec document vs. translation variant) and names the sibling tools for schema/template and post-creation retrieval, so an agent can separate it from create_prb/create_req and from get_dec.

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

Usage Guidelines5/5

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

Explicitly routes the agent to get_dec_schema for structure and get_dec_template/get_dec_example for authoring samples, and tells it to call get_dec afterward to fetch the full document since only frontmatter is returned. It also states the conditions that select each mode: omit language for a new document, supply a non-'en' code to create a translation of an existing id.

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