Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

vpc_stop_instance

Stop a running VPC virtual server instance by providing its ID. Optionally force the stop or specify a region.

Instructions

Stop a running VSI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYes
forceNo
regionNo

Implementation Reference

  • The handler for the vpc_stop_instance tool. It accepts an instance_id (string, required), force (boolean, optional), and region (string, optional). It calls the VPC API POST /instances/{instance_id}/actions with action type 'stop'. If force is true, the instance is force-stopped. Wrapped in safeTool for error handling, and calls assertWriteAllowed via the w() helper to enforce read-only mode.
    server.tool("vpc_stop_instance", "Stop a running VSI", {
      instance_id: z.string(), force: z.boolean().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w(); return client.post(vpcUrl(p.region||r, `/instances/${p.instance_id}/actions`),{type:"stop",force:p.force}); }));
  • The schema/input validation for vpc_stop_instance defined inline via zod: instance_id (z.string()), force (z.boolean().optional()), region (z.string().optional()).
    server.tool("vpc_stop_instance", "Stop a running VSI", {
      instance_id: z.string(), force: z.boolean().optional(), region: z.string().optional(),
    }, async (p) => safeTool(async () => { w(); return client.post(vpcUrl(p.region||r, `/instances/${p.instance_id}/actions`),{type:"stop",force:p.force}); }));
  • src/server.ts:53-53 (registration)
    Registration call: registerVPCTools(server, client, config) which registers all VPC tools including vpc_stop_instance on the MCP server.
    registerVPCTools(server, client, config);
  • The vpcUrl helper builds the full VPC API URL with version and generation parameters. Used by the handler to construct the URL for the stop instance API call.
    export function vpcUrl(region: string, path: string, version: string = "2024-11-19"): string {
      const base = `https://${region}.iaas.cloud.ibm.com/v1${path}`;
      const sep = base.includes("?") ? "&" : "?";
      return `${base}${sep}version=${version}&generation=2`;
    }
  • The safeTool helper wraps async tool handlers with try/catch, returning MCP-compatible success or error content blocks.
    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?

With no annotations, the description must cover behavioral traits. It only states the action but does not disclose effects like resource state changes, dependencies, or the impact of the 'force' parameter.

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

Conciseness2/5

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

Though very short, the description is under-specified and fails to include necessary detail. True conciseness would preserve essential information without sacrificing clarity.

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 the tool's simplicity (3 params, no output schema), the description omits important context like parameter roles and behavioral outcomes. It is not complete enough for confident use.

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

Parameters1/5

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

Schema coverage is 0%, so the description should explain parameter meanings. It adds nothing beyond the names; e.g., 'force' and 'region' are left entirely ambiguous.

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 'Stop a running VSI' uses a specific verb and resource name, clearly indicating the action and target. It distinguishes effectively from sibling tools like vpc_start_instance and vpc_reboot_instance.

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?

The description provides no context on when to use this tool versus alternatives (e.g., vpc_delete_instance or vpc_reboot_instance). It lacks any guidance on 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