Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

sm_rotate_secret

Rotate a secret in IBM Cloud Secrets Manager to replace its value with a new one, maintaining security posture.

Instructions

Rotate a secret

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYes
secret_idYes
payloadNoNew value (for arbitrary)
regionNo

Implementation Reference

  • Registration of the sm_rotate_secret tool with schema and handler on the MCP server.
    server.tool("sm_rotate_secret", "Rotate a secret", {
      instance_id: z.string(), secret_id: z.string(), payload: z.string().optional().describe("New value (for arbitrary)"),
      region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      return client.post(`${sm(p.instance_id,p.region)}/secrets/${p.secret_id}/rotate`, p.payload?{payload:p.payload}:{});
    }));
  • Zod schema defining input parameters: instance_id, secret_id, optional payload, optional region.
      instance_id: z.string(), secret_id: z.string(), payload: z.string().optional().describe("New value (for arbitrary)"),
      region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
  • Handler function that asserts write permission and POSTs to the Secrets Manager rotate endpoint with optional payload.
    }, async (p) => safeTool(async () => { w();
      return client.post(`${sm(p.instance_id,p.region)}/secrets/${p.secret_id}/rotate`, p.payload?{payload:p.payload}:{});
    }));
  • Helper utility 'assertWriteAllowed' called via w() in the handler to guard write operations.
    /**
     * Check if write operations are allowed, throw if not.
     */
    export function assertWriteAllowed(allowWrite: boolean): void {
  • Helper utility 'safeTool' that wraps the handler execution with error handling for MCP responses.
    export async function safeTool<T>(fn: () => Promise<T>): Promise<ReturnType<typeof successContent> | ReturnType<typeof errorContent>> {
      try {
        const result = await fn();
        return successContent(result);
      } catch (error) {
        return errorContent(error);
      }
    }
Behavior2/5

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

No annotations provided. Description fails to disclose behavioral traits such as whether the operation is idempotent, asynchronous, or requires specific permissions. The mutation nature is implied but not elaborated.

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

Conciseness3/5

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

Extremely concise (one sentence) and front-loaded, but sacrifices necessary detail. Adequate for a very simple tool, but not for one with 4 parameters.

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

Completeness2/5

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

Given 4 parameters, no output schema, and no annotations, the description is incomplete. It does not explain the rotation process, return value, or how parameters interact.

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

Parameters2/5

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

Schema coverage is only 25% (only payload described). Description does not add meaning beyond the schema; e.g., does not explain instance_id or secret_id roles in rotation.

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 'Rotate a secret' clearly states the verb and resource, but it does not differentiate from siblings like sm_create_secret or sm_get_secret. The purpose is clear but lacks specificity.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. No mention of prerequisites or context for rotation.

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/ahmedselimmansor-ctrl/IBM_cloud_MCP_SERVER'

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