Skip to main content
Glama

get_policy_summary

Retrieve a high-level summary of .q-ring.json governance policy—counts of allow/deny rules, approval and rotation requirements—to orient agents on active guardrails before policy-restricted actions.

Instructions

[policy] Return a high-level summary of the project's .q-ring.json governance policy — counts of allow/deny rules for tools, key reads, exec commands, plus approval and rotation requirements. Use to orient an agent (or the user) on what guardrails are active before attempting policy-restricted actions; prefer check_policy for a precise per-action verdict. Read-only. Returns pretty-printed JSON; missing policy file returns an empty/default summary rather than an error so callers can branch on the counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathNoAbsolute path to the project root for project-scoped secrets and policy resolution. Defaults to the MCP server's current working directory when omitted.

Implementation Reference

  • Core handler function that loads the project policy and returns a high-level summary with boolean flags for each policy section and the full PolicyConfig details.
    export function getPolicySummary(projectPath?: string): {
      hasMcpPolicy: boolean;
      hasExecPolicy: boolean;
      hasSecretPolicy: boolean;
      details: PolicyConfig;
    } {
      const policy = loadPolicy(projectPath);
      return {
        hasMcpPolicy: !!policy.mcp,
        hasExecPolicy: !!policy.exec,
        hasSecretPolicy: !!policy.secrets,
        details: policy,
      };
    }
  • MCP tool handler that registers 'get_policy_summary' as a server tool, enforces its own policy gate, calls getPolicySummary, and returns formatted JSON.
    server.tool(
      "get_policy_summary",
      [
        "[policy] Return a high-level summary of the project's `.q-ring.json` governance policy — counts of allow/deny rules for tools, key reads, exec commands, plus approval and rotation requirements.",
        "Use to orient an agent (or the user) on what guardrails are active before attempting policy-restricted actions; prefer `check_policy` for a precise per-action verdict.",
        "Read-only. Returns pretty-printed JSON; missing policy file returns an empty/default summary rather than an error so callers can branch on the counts.",
      ].join(" "),
      {
        projectPath,
      },
      async (params) => {
        const toolBlock = enforceToolPolicy(
          "get_policy_summary",
          params.projectPath,
        );
        if (toolBlock) return toolBlock;
        const summary = getPolicySummary(params.projectPath);
        return text(JSON.stringify(summary, null, 2));
      },
    );
  • Schema type definition for the policy configuration (PolicyConfig) that the summary reports on.
    export interface PolicyConfig {
      mcp?: {
        allowTools?: string[];
        denyTools?: string[];
        readableKeys?: string[];
        deniedKeys?: string[];
        deniedTags?: string[];
      };
      exec?: {
        allowCommands?: string[];
        denyCommands?: string[];
        maxRuntimeSeconds?: number;
        allowNetwork?: boolean;
      };
      secrets?: {
        requireApprovalForTags?: string[];
        requireRotationFormatForTags?: string[];
        maxTtlSeconds?: number;
      };
    }
  • Registration entry point that wires registerPolicyTools (which includes get_policy_summary) into the MCP server.
    export function registerMcpTools(server: McpServer): void {
      registerSecretTools(server);
      registerProjectTools(server);
      registerTunnelTools(server);
      registerTeleportTools(server);
      registerAuditTools(server);
      registerValidationTools(server);
      registerHookTools(server);
      registerToolingTools(server);
      registerAgentTools(server);
      registerPolicyTools(server);
    }
  • Helper used by the tool handler to enforce its own policy gate before executing.
    export function enforceToolPolicy(toolName: string, projectPath?: string) {
      const decision = checkToolPolicy(toolName, projectPath);
      if (!decision.allowed) {
        return text(
          `Policy Denied: ${decision.reason} (source: ${decision.policySource})`,
          true,
        );
      }
      return null;
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It declares read-only behavior, states the return format (pretty-printed JSON), and explains edge case (missing file returns empty/default summary instead of error). This gives agents confidence in safety and behavior, though auth requirements are not mentioned.

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?

The description is efficient with four sentences, each adding value. It is front-loaded with the core purpose. Could be slightly more concise, but no superfluous information.

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 the tool's simplicity (one parameter, no output schema), the description covers what is returned, usage guidance, and edge case handling. The missing file behavior is well-explained. Slightly more detail on the structure of the default summary could be added, but overall complete.

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

Parameters3/5

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

Schema description coverage is 100% with a clear explanation of the 'projectPath' parameter. The tool description does not add any additional parameter semantics beyond what the schema already provides, so a baseline of 3 is appropriate.

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 clearly states it returns a high-level summary of the .q-ring.json governance policy, specifying counts of allow/deny rules, approval, and rotation requirements. It distinguishes from sibling 'check_policy' by noting that tool is for precise per-action verdicts.

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 says to use this tool before policy-restricted actions to orient the agent, and to prefer 'check_policy' for precise per-action verdicts. Also mentions that missing policy file returns a default summary so callers can branch – providing clear when and when-not guidance.

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/I4cTime/quantum_ring'

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