Skip to main content
Glama

w3_space_add

Add, manage, and verify storage spaces on the IPFS network by providing UCAN proof or base64 identity CID strings via the MCP server.

Instructions

Tool for w3_space_add operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
proofYesFilesystem path to a CAR encoded UCAN proof, or a base64 identity CID string.

Implementation Reference

  • The handler function that implements the core logic for the 'w3_space_add' tool. It validates input arguments using the schema, executes the 'w3 space add' command with the provided proof, and returns the stdout output wrapped in a standardized MCP response.
    const handleW3SpaceAdd: ToolHandler = async (args) => {
      const parsed = Schemas.W3SpaceAddArgsSchema.safeParse(args);
      if (!parsed.success)
        throw new Error(
          `Invalid arguments for w3_space_add: ${parsed.error.message}`
        );
      const { proof } = parsed.data;
      const { stdout } = await runW3Command(`space add "${proof}"`);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              message: "Space added successfully from proof.",
              output: stdout.trim(),
            }),
          },
        ],
      };
    };
  • Zod schema defining the input arguments for the 'w3_space_add' tool, specifically requiring a 'proof' string which is a path to a CAR-encoded UCAN proof or a base64 identity CID.
    export const W3SpaceAddArgsSchema = z.object({
      proof: z
        .string()
        .describe(
          "Filesystem path to a CAR encoded UCAN proof, or a base64 identity CID string."
        ),
    });
  • Registration of the 'w3_space_add' handler in the toolHandlers map, which is used by the MCP server in index.ts to route CallTool requests to the appropriate handler.
    w3_space_add: handleW3SpaceAdd,

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