Skip to main content
Glama

create_guardrail

Create LLM or MCP-tool guardrails with checks and actions. Use it to define a policy anchor for downstream traffic and map MCP-tool guardrails to servers later.

Instructions

Create an LLM or MCP-tool guardrail. LLM guardrails require checks and actions; MCP-tool guardrails can be created first and mapped to servers afterward. The new version becomes the policy anchor for downstream use.

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": {
      "name": "<name>"
    },
    "name": "create_guardrail"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName of the guardrail
checksNoChecks to apply; at least one entry. Required when target is llm.
targetNoLLM traffic by default, or MCP tool calls
actionsNoActions to take when guardrail checks pass or fail
workspace_idNoWorkspace ID to create the guardrail in
organisation_idNoOrganisation ID (required if workspace_id not provided)

Output Schema

NameRequiredDescriptionDefault
okYesCall succeeded
dataNoSuccess payload
errorNoFailure details

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.16.5
    • changedOutput schema / properties / data / description
      Previous value: -"Structured success payload when ok is true"New value: +"Success payload"
    • changedOutput schema / properties / error / description
      Previous value: -"Structured error payload when ok is false"New value: +"Failure details"
    • changedOutput schema / properties / error / properties / details / description
      Previous value: -"Optional structured error details"New value: +"Extra error details"
    • changedOutput schema / properties / error / properties / message / description
      Previous value: -"Human-readable error message"New value: +"Error message"
    • changedOutput schema / properties / ok / description
      Previous value: -"Whether the tool call succeeded and returned structured data"New value: +"Call succeeded"
  2. Changed2 schema fields changedv1.0.9
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Changed3 schema fields changedv0.12.2
    • changedInput schema / properties / checks / description
      Previous value: -"Array of checks to apply (at least one required)"New value: +"Checks to apply; at least one entry. Required when target is llm."
    • addedInput schema / properties / target
      Added value: +{
      +  "description": "LLM traffic by default, or MCP tool calls",
      +  "enum": [
      +    "llm",
      +    "mcp_tools"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "name",
      -  "checks",
      -  "actions"
      -]New value: +[
      +  "name"
      +]
  4. Changed1 schema field changedv0.11.5
    • changedInput schema / properties / checks / items / properties / parameters / description
      Previous value: -"Check-specific configuration parameters"New value: +"Check-specific configuration. Supported examples include requestParametersCheck and parameters.forwardHeaders; forwarded headers can expose sensitive values, so allow only the minimum required names."
  5. Addedv1.0.1
  6. Removed
  7. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already establish that this is a non-destructive mutation with open-world effects. The description adds meaningful behavior beyond them by explaining target-specific requirements and that the new version becomes the policy anchor for downstream use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each carrying a distinct fact, with the core purpose front-loaded. There is no redundant or filler wording.

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 six-parameter creation tool with nested objects, full schema coverage, annotations, and an output schema, the description covers the essential concept and target variants. It leaves workspace/organisation scoping details to the schema, which is reasonable, but an explicit mention would have made the definition more complete.

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%, so the baseline is 3, but the description adds useful target-dependent context: checks and actions for LLM guardrails, and deferred server mapping for MCP-tool guardrails. Its claim that LLM guardrails require actions is slightly stronger than the schema's required fields, but the added semantic guidance is still valuable.

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?

The description opens with a specific verb and resource: "Create an LLM or MCP-tool guardrail." It also distinguishes the two target variants, making the tool's output immediately understandable without opening the 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?

It gives conditional usage context: LLM guardrails require checks and actions, while MCP-tool guardrails can be created first and mapped to servers later. It does not explicitly compare create_guardrail with update_guardrail or upsert-style alternatives, so it falls short of full when-to-use guidance.

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