Skip to main content
Glama
sniper35
by sniper35

attach_volume

Attach a storage volume to a Verda Cloud GPU instance to expand capacity. Ensure the instance is shut down before attaching the volume.

Instructions

Attach a volume to an instance.

Note: The instance must be shut down first.

Args: volume_id: The ID of the volume to attach. instance_id: The ID of the instance to attach to.

Returns: Confirmation of attachment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
volume_idYes
instance_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler for the attach_volume MCP tool. Decorated with @mcp.tool(), this async function takes volume_id and instance_id as parameters, calls the client's attach_volume method, and returns a confirmation message.
    @mcp.tool()
    async def attach_volume(volume_id: str, instance_id: str) -> str:
        """Attach a volume to an instance.
    
        Note: The instance must be shut down first.
    
        Args:
            volume_id: The ID of the volume to attach.
            instance_id: The ID of the instance to attach to.
    
        Returns:
            Confirmation of attachment.
        """
        client = _get_client()
        await client.attach_volume(volume_id, instance_id)
        return f"Volume `{volume_id}` attached to instance `{instance_id}`."
  • Client method that performs the actual volume attachment by calling the underlying SDK's _volumes.attach method through the async sync wrapper.
    async def attach_volume(self, volume_id: str, instance_id: str) -> None:
        """Attach a volume to an instance.
    
        Note: Instance must be shut down.
        """
        self._ensure_client()
        await self._run_sync(self._volumes.attach, volume_id, instance_id)
  • Helper function _get_client() that provides access to the global VerdaSDKClient instance used by the handler.
    def _get_client() -> VerdaSDKClient:
        """Get the global Verda client instance."""
        global _client
        if _client is None:
            _client = get_client()
        return _client
  • Volume dataclass defining the schema for volume representation with fields: id, name, size_gb, status, and attached_to.
    @dataclass
    class Volume:
        """Simplified volume representation."""
    
        id: str
        name: str
        size_gb: int
        status: str
        attached_to: str | None
    
        @classmethod
        def from_sdk(cls, vol: Any) -> "Volume":
            """Create from SDK Volume object."""
            return cls(
                id=vol.id,
                name=getattr(vol, "name", ""),
                size_gb=getattr(vol, "size", 0),
                status=getattr(vol, "status", "unknown"),
                attached_to=getattr(vol, "instance_id", None),
            )
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the shutdown prerequisite, which is a key behavioral trait, but lacks details on permissions needed, potential errors, or what happens if the instance isn't shut down. This leaves significant gaps for a mutation tool.

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 well-structured and front-loaded with the core purpose, followed by a critical note and clear parameter/return sections. Every sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's complexity (a mutation with prerequisites), no annotations, and an output schema present (which handles return values), the description does a solid job. It covers purpose, key usage rule, and parameter meanings, but could improve by addressing permissions or error cases to be fully complete.

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

Parameters4/5

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

The description explicitly lists both parameters with brief explanations ('volume_id: The ID of the volume to attach', 'instance_id: The ID of the instance to attach to'), adding meaningful context beyond the schema's 0% coverage. This compensates well for the lack of schema descriptions, though it doesn't elaborate on format or validation rules.

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 verb 'attach' and the resources 'volume' and 'instance', making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'detach_volume', but the action is specific enough to infer the distinction.

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

Usage Guidelines4/5

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

The description provides explicit guidance with 'Note: The instance must be shut down first,' which is crucial context for when to use this tool. However, it doesn't mention alternatives like 'detach_volume' or prerequisites beyond the shutdown requirement, leaving some gaps in full usage context.

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/sniper35/verda-cloud-mcp'

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