Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

sm_create_secret

Create a new secret in IBM Cloud Secrets Manager. Specify type and payload to store sensitive data securely.

Instructions

Create a new secret

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYes
nameYes
secret_typeYes
payloadYesSecret value or JSON of fields depending on type
secret_group_idNo
regionNo

Implementation Reference

  • The tool handler for sm_create_secret. It builds the request body based on secret_type (arbitrary, kv, or other JSON-based types) and posts to the Secrets Manager API endpoint.
    server.tool("sm_create_secret", "Create a new secret", {
      instance_id: z.string(), name: z.string(),
      secret_type: z.enum(["arbitrary","username_password","iam_credentials","kv","public_cert","private_cert","service_credentials"]),
      payload: z.string().describe("Secret value or JSON of fields depending on type"),
      secret_group_id: z.string().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      const body: Record<string,unknown> = {name:p.name, secret_type:p.secret_type, secret_group_id:p.secret_group_id};
      if(p.secret_type==="arbitrary") body.payload=p.payload;
      else if(p.secret_type==="kv") body.data=JSON.parse(p.payload);
      else Object.assign(body, JSON.parse(p.payload));
      return client.post(`${sm(p.instance_id,p.region)}/secrets`, body);
    }));
  • Schema definition for sm_create_secret: input parameters including instance_id, name, secret_type (enum), payload, optional secret_group_id and region.
    server.tool("sm_create_secret", "Create a new secret", {
      instance_id: z.string(), name: z.string(),
      secret_type: z.enum(["arbitrary","username_password","iam_credentials","kv","public_cert","private_cert","service_credentials"]),
      payload: z.string().describe("Secret value or JSON of fields depending on type"),
      secret_group_id: z.string().optional(), region: z.string().optional(),
  • The tool is registered via server.tool('sm_create_secret', ...) inside the registerSecurityTools function.
    server.tool("sm_create_secret", "Create a new secret", {
      instance_id: z.string(), name: z.string(),
      secret_type: z.enum(["arbitrary","username_password","iam_credentials","kv","public_cert","private_cert","service_credentials"]),
      payload: z.string().describe("Secret value or JSON of fields depending on type"),
      secret_group_id: z.string().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      const body: Record<string,unknown> = {name:p.name, secret_type:p.secret_type, secret_group_id:p.secret_group_id};
      if(p.secret_type==="arbitrary") body.payload=p.payload;
      else if(p.secret_type==="kv") body.data=JSON.parse(p.payload);
      else Object.assign(body, JSON.parse(p.payload));
      return client.post(`${sm(p.instance_id,p.region)}/secrets`, body);
    }));
  • src/server.ts:74-75 (registration)
    The registerSecurityTools function is called from createServer() in server.ts, registering all security-related tools including sm_create_secret.
    registerSecurityTools(server, client, config);
    console.error(`  ✓ Security (12 tools)`);
  • The sm helper function builds the Secrets Manager API endpoint URL using IBM_ENDPOINTS.SECRETS_MANAGER with the instance ID and region.
      client.request(`${kp(p.region)}/keys`, {headers:{"Bluemix-Instance":p.instance_id}, queryParams:{limit:p.limit||200}})
    ));
    
    server.tool("kp_create_key", "Create a new encryption key", {
Behavior2/5

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

No annotations are provided, so the description should disclose behavioral aspects. However, it only states 'Create a new secret' without detailing side effects, permissions, idempotency, or error conditions.

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?

The description is extremely concise (4 words), but it sacrifices necessary detail. It is not wasteful, but under-specification reduces its effectiveness.

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 6 parameters and no output schema or annotations, the description fails to provide essential context about required fields, secret types, or payload format, leaving the agent under-informed.

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?

With schema description coverage at 17%, the description should compensate. But it adds no parameter explanations. The only described parameter in schema is 'payload', yet the description ignores even that. No value added beyond the schema.

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 'Create a new secret' clearly states the action and resource, distinguishing it from sibling tools like sm_get_secret, sm_delete_secret, sm_list_secrets, and sm_rotate_secret.

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 usage guidelines are provided. The description does not specify when to use this tool vs alternatives, nor does it mention prerequisites or scenarios.

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