Skip to main content
Glama
backworkai
by backworkai

get_policy_changes

Track Medicare coverage policy updates, new policies, and retirements by filtering changes by date, policy ID, or change type.

Instructions

Track recent changes to Medicare coverage policies. Useful for monitoring updates, new policies, and retirements. Can filter by date, policy ID, or change type.

Examples:

  • get_policy_changes() - recent changes

  • get_policy_changes({ since: "2024-01-01T00:00:00Z" }) - changes since date

  • get_policy_changes({ policy_id: "L33831" }) - changes to specific policy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNoISO8601 timestamp - only changes after this date
policy_idNoFilter to a specific policy
change_typeNoFilter by type of change
limitNoResults per page
cursorNoPagination cursor

Implementation Reference

  • The main handler function that queries the Verity API for policy changes based on input parameters, handles pagination, and formats the results into a structured text response for the MCP client.
    async ({ since, policy_id, change_type, limit, cursor }) => {
      try {
        const result = await verityRequest<any>("/policies/changes", {
          params: { since, policy_id, change_type, limit, cursor },
        });
    
        if (!result.data || result.data.length === 0) {
          return {
            content: [{ type: "text", text: "No policy changes found for the specified criteria." }],
          };
        }
    
        const lines: string[] = [`Found ${result.data.length} policy changes:\n`];
    
        result.data.forEach((change: any) => {
          lines.push(`[${change.change_type.toUpperCase()}] ${change.policy_id}: ${change.policy_title}`);
          if (change.changed_at) lines.push(`  Date: ${change.changed_at}`);
          if (change.change_summary) lines.push(`  Summary: ${change.change_summary}`);
          if (change.details?.changed_fields) lines.push(`  Fields: ${change.details.changed_fields.join(", ")}`);
          if (change.details?.added_codes?.length) lines.push(`  Added codes: ${change.details.added_codes.join(", ")}`);
          if (change.details?.removed_codes?.length) lines.push(`  Removed codes: ${change.details.removed_codes.join(", ")}`);
          lines.push("");
        });
    
        if (result.meta?.pagination?.cursor) {
          lines.push(`More changes available. Use cursor: "${result.meta.pagination.cursor}"`);
        }
    
        return {
          content: [{ type: "text", text: lines.join("\n") }],
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error getting policy changes: ${error instanceof Error ? error.message : String(error)}` }],
        };
      }
    }
  • Zod-based input schema defining optional parameters for filtering policy changes by date, ID, type, with pagination support.
    inputSchema: {
      since: z.string().optional().describe("ISO8601 timestamp - only changes after this date"),
      policy_id: z.string().max(50).optional().describe("Filter to a specific policy"),
      change_type: z
        .enum(["created", "updated", "retired", "codes_changed", "criteria_changed", "metadata_changed"])
        .optional()
        .describe("Filter by type of change"),
      limit: z.number().min(1).max(100).default(20).describe("Results per page"),
      cursor: z.string().optional().describe("Pagination cursor"),
    },
  • src/index.ts:486-545 (registration)
    The server.registerTool call that registers the 'get_policy_changes' tool with the MCP server, including its description, input schema, and handler function.
    server.registerTool(
      "get_policy_changes",
      {
        description: `Track recent changes to Medicare coverage policies.
    Useful for monitoring updates, new policies, and retirements.
    Can filter by date, policy ID, or change type.
    
    Examples:
    - get_policy_changes() - recent changes
    - get_policy_changes({ since: "2024-01-01T00:00:00Z" }) - changes since date
    - get_policy_changes({ policy_id: "L33831" }) - changes to specific policy`,
        inputSchema: {
          since: z.string().optional().describe("ISO8601 timestamp - only changes after this date"),
          policy_id: z.string().max(50).optional().describe("Filter to a specific policy"),
          change_type: z
            .enum(["created", "updated", "retired", "codes_changed", "criteria_changed", "metadata_changed"])
            .optional()
            .describe("Filter by type of change"),
          limit: z.number().min(1).max(100).default(20).describe("Results per page"),
          cursor: z.string().optional().describe("Pagination cursor"),
        },
      },
      async ({ since, policy_id, change_type, limit, cursor }) => {
        try {
          const result = await verityRequest<any>("/policies/changes", {
            params: { since, policy_id, change_type, limit, cursor },
          });
    
          if (!result.data || result.data.length === 0) {
            return {
              content: [{ type: "text", text: "No policy changes found for the specified criteria." }],
            };
          }
    
          const lines: string[] = [`Found ${result.data.length} policy changes:\n`];
    
          result.data.forEach((change: any) => {
            lines.push(`[${change.change_type.toUpperCase()}] ${change.policy_id}: ${change.policy_title}`);
            if (change.changed_at) lines.push(`  Date: ${change.changed_at}`);
            if (change.change_summary) lines.push(`  Summary: ${change.change_summary}`);
            if (change.details?.changed_fields) lines.push(`  Fields: ${change.details.changed_fields.join(", ")}`);
            if (change.details?.added_codes?.length) lines.push(`  Added codes: ${change.details.added_codes.join(", ")}`);
            if (change.details?.removed_codes?.length) lines.push(`  Removed codes: ${change.details.removed_codes.join(", ")}`);
            lines.push("");
          });
    
          if (result.meta?.pagination?.cursor) {
            lines.push(`More changes available. Use cursor: "${result.meta.pagination.cursor}"`);
          }
    
          return {
            content: [{ type: "text", text: lines.join("\n") }],
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error getting policy changes: ${error instanceof Error ? error.message : String(error)}` }],
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions tracking changes and filtering, but fails to disclose key behavioral traits: it doesn't specify if this is a read-only operation, what permissions are needed, whether there are rate limits, or the format of returned data. The examples hint at pagination ('limit' parameter) but don't explain it. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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 appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by brief usage notes and helpful examples. The examples are relevant but could be more integrated; overall, there's little wasted text, and the structure supports quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, no output schema, no annotations), the description is moderately complete. It covers purpose and basic usage but lacks details on behavioral aspects (e.g., safety, permissions) and output format. Without annotations or output schema, the agent must infer behavior from the description alone, which is insufficient for full transparency. It's adequate but has clear gaps.

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%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema: it lists filtering options ('date, policy ID, or change type') and provides usage examples, but doesn't explain parameter interactions or add semantic context not in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Track recent changes to Medicare coverage policies' with specific verbs ('track', 'monitor') and resources ('changes', 'policies'). It distinguishes from siblings like 'get_policy' (single policy) and 'search_policies' (searching rather than tracking changes), though not explicitly. The purpose is specific but could be more explicit about sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The description provides implied usage through examples (e.g., 'Useful for monitoring updates') and parameter examples, but lacks explicit guidance on when to use this tool versus alternatives like 'get_policy' or 'search_policies'. It mentions filtering capabilities but doesn't specify scenarios where this tool is preferred over siblings, leaving some ambiguity.

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/backworkai/verity_mcp'

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