Skip to main content
Glama

w3_space_use

Select and manage specific IPFS spaces using their decentralized identifier (DID) with the mcp-ipfs server. Simplify operations like data uploads, downloads, and delegations for efficient storage management.

Instructions

Tool for w3_space_use operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceDidYesThe DID of the space to select (e.g., did:key:...).

Implementation Reference

  • The handler function that executes the w3_space_use tool. It validates input arguments using the schema, runs the 'w3 space use' command with the provided spaceDid, and returns a JSON-formatted response with success message and command output.
    const handleW3SpaceUse: ToolHandler = async (args) => {
      const parsed = Schemas.W3SpaceUseArgsSchema.safeParse(args);
      if (!parsed.success)
        throw new Error(
          `Invalid arguments for w3_space_use: ${parsed.error.message}`
        );
      const { spaceDid } = parsed.data;
      const { stdout } = await runW3Command(`space use ${spaceDid}`);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              message: `Successfully set current space to ${spaceDid}`,
              output: stdout.trim(),
            }),
          },
        ],
      };
    };
  • Zod schema for the input arguments of the w3_space_use tool, defining 'spaceDid' as a required string that must start with 'did:key:'.
    export const W3SpaceUseArgsSchema = z.object({
      spaceDid: z
        .string()
        .startsWith("did:key:")
        .describe("The DID of the space to select (e.g., did:key:...)."),
    });
  • The toolHandlers object maps tool names to their handler functions, registering 'w3_space_use' to handleW3SpaceUse. This object is imported and used in index.ts for dynamic tool execution.
    export const toolHandlers: Record<string, ToolHandler> = {
      w3_login: handleW3Login,
      w3_space_ls: handleW3SpaceLs,
      w3_space_use: handleW3SpaceUse,
      w3_space_create: handleW3SpaceCreate,
      w3_up: handleW3Up,
      w3_ls: handleW3Ls,
      w3_rm: handleW3Rm,
      w3_open: handleW3Open,
      w3_space_info: handleW3SpaceInfo,
      w3_space_add: handleW3SpaceAdd,
      w3_delegation_create: handleW3DelegationCreate,
      w3_delegation_ls: handleW3DelegationLs,
      w3_delegation_revoke: handleW3DelegationRevoke,
      w3_proof_add: handleW3ProofAdd,
      w3_proof_ls: handleW3ProofLs,
      w3_key_create: handleW3KeyCreate,
      w3_bridge_generate_tokens: handleW3BridgeGenerateTokens,
      w3_can_blob_add: handleW3CanBlobAdd,
      w3_can_blob_ls: handleW3CanBlobLs,
      w3_can_blob_rm: handleW3CanBlobRm,
      w3_can_index_add: handleW3CanIndexAdd,
      w3_can_upload_add: handleW3CanUploadAdd,
      w3_can_upload_ls: handleW3CanUploadLs,
      w3_can_upload_rm: handleW3CanUploadRm,
      w3_plan_get: handleW3PlanGet,
      w3_account_ls: handleW3AccountLs,
      w3_space_provision: handleW3SpaceProvision,
      w3_coupon_create: handleW3CouponCreate,
      w3_usage_report: handleW3UsageReport,
      w3_can_access_claim: handleW3CanAccessClaim,
      w3_can_store_add: handleW3CanStoreAdd,
      w3_can_store_ls: handleW3CanStoreLs,
      w3_can_store_rm: handleW3CanStoreRm,
      w3_can_filecoin_info: handleW3CanFilecoinInfo,
      w3_reset: handleW3Reset,
    };
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It offers no information on whether the operation is read-only or destructive, what permissions are required, or any side effects (e.g., rate limits, state changes). The vague term 'operation' gives no insight into behavior beyond the name.

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?

While concise (one sentence), the description is under-specified rather than efficiently informative. It wastes its limited space on a tautological statement that adds no value, failing to front-load useful information. Conciseness should not come at the cost of clarity.

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 the lack of annotations and output schema, the description is severely incomplete. It does not explain the tool's purpose, behavior, or output, leaving the agent unable to understand or use it effectively. For a tool with one parameter but no other context, this description fails to provide necessary information.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'spaceDid' clearly documented in the schema (including pattern and example). The description adds no parameter semantics beyond what the schema provides, but the baseline is 3 since the schema adequately covers the parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Tool for w3_space_use operation' is a tautology that merely restates the tool name with minimal added meaning. It lacks a specific verb or resource description, failing to clarify what the tool actually does (e.g., select, activate, or utilize a space). Compared to siblings like 'w3_space_add' or 'w3_space_ls', it provides no differentiation.

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

Usage Guidelines1/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. The description does not mention any context, prerequisites, or exclusions, nor does it reference sibling tools (e.g., 'w3_space_info' or 'w3_space_ls') that might serve similar purposes. This leaves the agent with no basis for selection.

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

Related 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/alexbakers/mcp-ipfs'

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