Skip to main content
Glama

Draft rules from a policy

import_policy_rules
Read-only

Convert a written policy document into DRAFT decision rules (LLM-assisted).

Instructions

Convert a written policy document into DRAFT decision rules (LLM-assisted).

Returns validated draft rules (when/action, including chained asserts where the policy stages its determinations), derived rule→rule edges, and overlap warnings. Each returned rule carries a citation field holding the policy sentence it encodes (also summarized in the top-level citations map). Coverage runs the other way too: uncovered_sentences lists policy sentences no rule's citation points back to (out of policy_sentence_count), and unverified_citations names rules whose quote is missing or not found verbatim in the policy. Show both to the user: an uncovered sentence may need a rule; an unverified one may be a paraphrase that misstates the policy. background_sentences is the subset of uncovered sentences with no obligation language (definitions, preamble); lead with the others, but mention these too, since the split is a keyword heuristic. NOTHING IS SAVED: review the drafts (and show them to the user), then persist explicitly with put_rules — validate first with dry_run=true, and keep each rule's citation in the YAML you save so the audit trail back to the policy survives.

Args: domain: Domain the rules are drafted for (an owned domain or a new name). policy_text: The policy document text (max ~50k characters).

Input Schema

NameRequiredDescriptionDefault
domainYes
policy_textYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.3

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare only readOnlyHint=true; the description goes well beyond that by disclosing the LLM-assisted/non-deterministic nature, the citation-back-to-policy audit model, the unverified-citation risk (paraphrase may misstate policy), and that the background/uncovered split is a keyword heuristic. This is real behavioral context an agent can't get from the structured fields.

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?

Purpose is front-loaded and the guidance is actionable, but the middle section spends considerable space enumerating return fields (uncovered_sentences, policy_sentence_count, citations) that an output schema already defines. The user-facing advice about leading with obligation-bearing sentences earns its place; the field-by-field restatement is the weakest part.

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 an output schema (so return shape needn't be re-derived) and readOnlyHint covering safety, the description still supplies the missing behavioral layer: what is not persisted, how coverage gaps should be surfaced to the user, and the required follow-up call. Nothing needed to invoke it correctly is absent.

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% (bare titles), so the description carries the full burden and does compensate: domain is 'an owned domain or a new name' and policy_text has a 'max ~50k characters' limit. Both meanings are added, though 'owned domain' could be elaborated further and no cost/latency note is given for the LLM call.

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 and resource ('Convert a written policy document into DRAFT decision rules'), with 'LLM-assisted' and 'DRAFT' qualifying the nature of the output. It also names the sibling it hands off to ('put_rules'), so an agent can distinguish this drafting step from persistence without opening either schema.

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?

Explicit workflow: draft here, review/show to the user, validate with dry_run=true, then persist with put_rules. The exclusionary condition is spelled out ('NOTHING IS SAVED'), which tells the agent exactly when this tool is not sufficient on its own.

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