Skip to main content
Glama

Validate and lint a policy

validate_policy
Read-onlyIdempotent

Check a policy against the same schema rules as policy_check, then lint it: no rules at all, duplicate or overlapping price items, duplicate forbid ids or phrases, prices that cannot be stated in cents, and rules the checker never fires on (probed with the shipped checker). Returns valid, errors and warnings. Nothing is stored. A valid policy is not a complete one, and grants no execution authority.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "policy": "<policy>"
    },
    "name": "validate_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyYesYour rules. Set at least one of prices, forbid or actions; validate_policy lints a policy before use. Ready-made policies: https://curbi.io/policies/

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / policy / properties / forbid / items / properties / match
      Added value: +{
      +  "description": "Default \"word\": whole words, plus English endings. \"prefix\" also matches words that start with the phrase, for languages that add endings (\"garanti\" catches \"garantili\"); it can over-match (\"free\" would catch \"freedom\"), so use it per rule.",
      +  "enum": [
      +    "word",
      +    "prefix"
      +  ],
      +  "type": "string"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / policy / additionalProperties
      Added value: +false
    • addedInput schema / properties / policy / description
      Added value: +"Your rules. Set at least one of prices, forbid or actions; validate_policy lints a policy before use. Ready-made policies: https://curbi.io/policies/"
    • addedInput schema / properties / policy / properties
      Added value: +{
      +  "actions": {
      +    "additionalProperties": {
      +      "description": "Operation that must be DONE in the record.",
      +      "maxLength": 60,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "description": "Past-tense verb to operation, for example {\"refunded\": \"billing.refund\"}. Claiming the verb needs that operation DONE in the record.",
      +    "maxProperties": 40,
      +    "propertyNames": {
      +      "pattern": "^[a-z]{2,20}$"
      +    },
      +    "type": "object"
      +  },
      +  "description": {
      +    "description": "Optional policy description.",
      +    "type": "string"
      +  },
      +  "discounts": {
      +    "description": "Approved discounts. Any other \"N% off\" claim is a finding.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "items": {
      +          "description": "Price items it applies to; omit for all.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "percent": {
      +          "description": "Percent off.",
      +          "exclusiveMinimum": 0,
      +          "maximum": 100,
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "percent"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 20,
      +    "type": "array"
      +  },
      +  "forbid": {
      +    "description": "Phrases the agent must not say.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "id": {
      +          "description": "Lowercase slug. Findings are reported as forbid:<id>.",
      +          "pattern": "^[a-z0-9-]{1,40}$",
      +          "type": "string"
      +        },
      +        "negatable": {
      +          "description": "Default true: a negated mention (\"we do not guarantee\") passes.",
      +          "type": "boolean"
      +        },
      +        "phrases": {
      +          "description": "Literal phrases, never regular expressions.",
      +          "items": {
      +            "maxLength": 80,
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "maxItems": 20,
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "why": {
      +          "description": "Reason shown with the finding.",
      +          "maxLength": 200,
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "phrases"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 50,
      +    "type": "array"
      +  },
      +  "name": {
      +    "description": "Optional policy name.",
      +    "type": "string"
      +  },
      +  "prices": {
      +    "description": "Approved prices in USD. A wrong price, another currency, or an unapproved discount for an item is a finding.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "aliases": {
      +          "description": "Names to match instead of item, for example [\"Pro\", \"Pro plan\"].",
      +          "items": {
      +            "maxLength": 80,
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "maxItems": 8,
      +          "type": "array"
      +        },
      +        "amount": {
      +          "description": "The approved price. Use amount or amounts, not both.",
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "amounts": {
      +          "description": "Several approved prices for the item, such as monthly and annual.",
      +          "items": {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "maxItems": 8,
      +          "minItems": 1,
      +          "type": "array"
      +        },
      +        "item": {
      +          "description": "Item name as customers say it, for example \"Pro\".",
      +          "maxLength": 80,
      +          "minLength": 1,
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "item"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 50,
      +    "type": "array"
      +  },
      +  "unknownAmounts": {
      +    "description": "\"flag\" (default) reports dollar amounts not tied to an approved price; \"allow\" ignores them.",
      +    "enum": [
      +      "flag",
      +      "allow"
      +    ],
      +    "type": "string"
      +  }
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds real value: 'Nothing is stored', no execution authority is granted, a valid policy is not a complete one, and the checking is 'probed with the shipped checker' so the agent knows findings reflect actual runtime behavior. Return surface is summarized as valid/errors/warnings, though the warning-vs-error severity mapping is not spelled out.

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?

A single front-loaded paragraph that leads with what it does and follows with the lint list, then the guarantees. The long comma-spliced list of checks is dense on first read but each clause carries distinct information; nothing is padding.

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?

For a read-only validator with no output schema, the description covers the important unknowns: side-effect freedom, authority boundaries, and the rough shape of the result. The only gap is the precise structure of the returned errors/warnings beyond the three top-level keys.

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 100% and the nested policy schema is richly documented, so the baseline is 3. The description earns one more by tying its lint categories back to specific fields — duplicate/overlapping price items, duplicate forbid ids or phrases, prices not statable in cents — which tells the agent which parts of the policy object actually get scrutinized.

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?

Specific verb+resource ('Check a policy... then lint it') plus an enumerated list of lint categories, and it explicitly positions itself against the sibling policy_check ('same schema rules as policy_check, then lint it'). An agent can distinguish this from policy_check 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 Guidelines4/5

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

The relative-to-sibling framing implies the selection rule: use this when you want schema checks plus linting, policy_check when you only need schema checks. It also warns that a clean result does not mean the policy is complete. It stops short of an explicit 'use X when / use Y when-not' statement or naming the other siblings (fetch, search, verify_bundle).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources