Skip to main content
Glama
jstibal

Openterms-mcp

get_policy

Retrieve active guardrail policies to understand workspace constraints, including spending caps, action whitelists, and escalation rules for AI agents.

Instructions

Get the active policy (guardrails) for this workspace. Returns the rules that govern what this agent is allowed to do. An agent SHOULD call this on startup to understand its constraints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'get_policy' retrieves policy information from the API and formats it into a human-readable string.
    elif name == "get_policy":
        resp = client.get("/v1/policy", headers=_headers())
        if resp.status_code == 200:
            policy = resp.json()
            if not policy.get("active") and policy.get("active") is not True:
                if policy.get("version", 0) == 0:
                    return "No active policy. All actions are allowed."
            rules = policy.get("rules", [])
            lines = [
                f"Active policy (version {policy.get('version', '?')}):",
                f"  Rules ({len(rules)}):"
            ]
            for i, rule in enumerate(rules):
                rtype = rule.get("type", "unknown")
                if rtype in ("max_amount_per_receipt", "daily_spend_cap", "max_action_context_keys"):
                    lines.append(f"    {i+1}. {rtype}: limit={rule.get('limit')}")
                elif rtype == "escalate_above_amount":
                    lines.append(f"    {i+1}. {rtype}: threshold={rule.get('threshold')}")
                elif rtype in ("allowed_action_types", "blocked_action_types"):
                    lines.append(f"    {i+1}. {rtype}: {rule.get('values')}")
                elif rtype == "required_terms_url_prefix":
                    lines.append(f"    {i+1}. {rtype}: {rule.get('prefix')}")
                else:
                    lines.append(f"    {i+1}. {rtype}: {json.dumps(rule)}")
            return "\n".join(lines)
        return _format_error(resp)
  • Registration and schema definition for the 'get_policy' tool.
    {
        "name": "get_policy",
        "description": (
            "Get the active policy (guardrails) for this workspace. "
            "Returns the rules that govern what this agent is allowed to do. "
            "An agent SHOULD call this on startup to understand its constraints."
        ),
        "inputSchema": {"type": "object", "properties": {}},
    },
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses what the tool returns ('rules that govern what this agent is allowed to do'), implying a read-only retrieval of configuration data. However, it lacks details on caching behavior, idempotency, or whether the policy can change during a session.

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 with zero waste: first defines the action, second clarifies the return value, third provides usage timing. Front-loaded with the core action 'Get the active policy' and efficiently structured.

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?

Given zero parameters, no annotations, and no output schema, the description adequately covers the tool's function, return value nature, and startup usage pattern. Complete enough for a simple configuration retrieval tool, though mentioning the relationship to 'policy_decisions' would strengthen it further.

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?

Input schema contains zero parameters (empty properties object). Per rubric, 0 params establishes baseline of 4. Description appropriately does not invent parameter semantics where none exist.

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 ('Get') + resource ('active policy/guardrails') + scope ('this workspace'). The parenthetical '(guardrails)' clarifies the concept, and the description distinguishes this from siblings like 'simulate_policy' or 'policy_decisions' by focusing on retrieval of rules rather than evaluation or simulation.

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?

Explicitly states when to use: 'An agent SHOULD call this on startup to understand its constraints.' This provides clear temporal guidance. However, it does not explicitly differentiate when to use this versus 'policy_decisions' or 'simulate_policy' for runtime constraint checking.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jstibal/openterms-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server