Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

cos_put_object

Uploads a text object to an IBM Cloud Object Storage bucket, given the bucket name, object key, and content. Optionally specify content type.

Instructions

Upload an object to a bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes
object_keyYes
contentYesObject content (text)
content_typeNoMIME type
regionNo

Implementation Reference

  • Handler for the cos_put_object tool. Makes a PUT request to the COS S3 endpoint with the object content as the body. Calls w() (assertWriteAllowed) to enforce read-only mode if configured.
    server.tool("cos_put_object", "Upload an object to a bucket", {
      bucket_name: z.string(), object_key: z.string(), content: z.string().describe("Object content (text)"),
      content_type: z.string().optional().describe("MIME type"), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      return client.request(`${s3(p.region||r)}/${p.bucket_name}/${encodeURIComponent(p.object_key)}`, {
        method:"PUT",
        headers:{"Content-Type":p.content_type||"text/plain"},
        body:p.content,
      });
    }));
  • Input schema for cos_put_object: bucket_name (required), object_key (required), content (required text), content_type (optional MIME type), region (optional, defaults to server config region).
    bucket_name: z.string(), object_key: z.string(), content: z.string().describe("Object content (text)"),
    content_type: z.string().optional().describe("MIME type"), region: z.string().optional(),
  • Registration of the cos_put_object tool on the MCP server via server.tool() call, within the registerCOSTools function.
    server.tool("cos_put_object", "Upload an object to a bucket", {
      bucket_name: z.string(), object_key: z.string(), content: z.string().describe("Object content (text)"),
      content_type: z.string().optional().describe("MIME type"), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w();
      return client.request(`${s3(p.region||r)}/${p.bucket_name}/${encodeURIComponent(p.object_key)}`, {
        method:"PUT",
        headers:{"Content-Type":p.content_type||"text/plain"},
        body:p.content,
      });
    }));
  • src/server.ts:59-59 (registration)
    Top-level registration call that wires up all COS tools including cos_put_object during server initialization.
    registerCOSTools(server, client, config);
  • Helper function used by the handler to enforce read-only mode. Calls w() which invokes assertWriteAllowed(config.allowWrite).
    export function assertWriteAllowed(allowWrite: boolean): void {
      if (!allowWrite) {
        throw new WriteNotAllowedError();
      }
    }
Behavior2/5

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

With no annotations provided, the description should disclose behavioral traits. It only indicates 'upload' (implying write/create/overwrite) but omits details like idempotency, permission requirements, or size limits for the content.

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?

The description is a single, front-loaded sentence with no extraneous words. It is optimally concise.

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

Completeness1/5

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

Given five parameters, no output schema, and no annotations, the description is severely incomplete. It lacks critical context such as return values, error handling, file size restrictions, and authentication requirements for an upload operation.

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 40% (2 of 5 parameters have descriptions). The description adds no parameter details beyond what the schema provides. It fails to compensate for the low coverage.

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 'Upload an object to a bucket' clearly states the action and resource. It distinguishes from sibling tools like cos_get_object, cos_delete_object, and cos_copy_object by specifying an upload operation.

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 is provided on when to use this tool versus alternatives. There is no mention of prerequisites, when not to use it, or comparisons to other COS tools.

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