Skip to main content
Glama

w3_space_info

Retrieve information about a specific or current storage space on the MCP-IPFS server. Verify login status and specify a space DID to access detailed space metadata in JSON format.

Instructions

Tool for w3_space_info operation. NOTE: no current space and no space given or {"spaces":[]} first make sure you are logged in before using other tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonNoFormat output as newline delimited JSON (default: true).
spaceDidNoOptional DID of the space to get info for (defaults to current space).

Implementation Reference

  • The main handler function for the 'w3_space_info' tool. It validates input arguments using the schema, constructs the appropriate 'w3 space info' CLI command based on optional spaceDid and json flags, executes it via runW3Command, parses the output (handling both NDJSON and single JSON), and returns a structured MCP response.
    const handleW3SpaceInfo: ToolHandler = async (args) => {
      const parsed = Schemas.W3SpaceInfoArgsSchema.safeParse(args);
      if (!parsed.success)
        throw new Error(
          `Invalid arguments for w3_space_info: ${parsed.error.message}`
        );
      const { spaceDid, json } = parsed.data;
      let command = "space info";
      if (spaceDid) command += ` --space ${spaceDid}`;
      if (json) command += " --json";
      const { stdout } = await runW3Command(command);
      if (json) {
        try {
          const info = parseNdJson(stdout);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ spaceInfo: info.length > 0 ? info[0] : {} }),
              },
            ],
          };
        } catch (e) {
          try {
            const singleInfo = JSON.parse(stdout);
            return {
              content: [
                { type: "text", text: JSON.stringify({ spaceInfo: singleInfo }) },
              ],
            };
          } catch (e2) {
            logger.warn(
              `w3_space_info: Failed to parse output as NDJSON or JSON: ${stdout}`
            );
            throw new Error(
              `Failed to parse JSON output for w3_space_info. Raw output: ${stdout}`
            );
          }
        }
      } else {
        return {
          content: [
            { type: "text", text: JSON.stringify({ output: stdout.trim() }) },
          ],
        };
      }
    };
  • Zod schema defining the input parameters for the w3_space_info tool: optional spaceDid (must start with 'did:key:') and optional json boolean (defaults to true). This schema is used for validation in the handler.
    export const W3SpaceInfoArgsSchema = z.object({
      spaceDid: z
        .string()
        .startsWith("did:key:")
        .optional()
        .describe(
          "Optional DID of the space to get info for (defaults to current space)."
        ),
      json: z
        .boolean()
        .optional()
        .default(true)
        .describe("Format output as newline delimited JSON (default: true)."),
    });
  • The toolHandlers map registers 'w3_space_info' (line 953) with its handler function handleW3SpaceInfo. This map is imported and used in src/index.ts to route CallTool requests to the appropriate handler.
    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,
    };
  • src/index.ts:94-125 (registration)
    The MCP server's CallTool request handler in index.ts that looks up the tool name in the imported toolHandlers map and invokes the corresponding handler function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      logger.info(`Handling CallTool request for: ${name}`);
    
      const handler = toolHandlers[name];
    
      if (!handler) {
        logger.error(`Unknown tool requested: ${name}`);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ error: `Unknown tool: ${name}` }),
            },
          ],
          isError: true,
        };
      }
    
      try {
        const result = await handler(args);
        return result;
      } catch (error: any) {
        logger.error(`Error handling tool '${name}':`, error);
        return {
          content: [
            { type: "text", text: JSON.stringify({ error: error.message }) },
          ],
          isError: true,
        };
      }
    });
Behavior2/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 login requirements and edge case handling, which adds some context. However, it doesn't describe what information is returned, whether this is a read-only operation, potential error conditions, or any rate limits. For a tool that presumably retrieves space information, the behavioral description is incomplete.

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?

The description is poorly structured and not front-loaded. It starts with a tautological statement, then includes important login and edge case information as an afterthought. The sentences are awkwardly constructed, and the note about login status should be more prominent if it's a critical prerequisite. The description could be much more efficiently organized.

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 no annotations and no output schema, the description should provide more complete context about what this tool does and returns. While it mentions login requirements and edge cases, it doesn't explain what 'space info' actually includes, what format the information comes in, or how to interpret the results. For a tool with 2 parameters and presumably returning space information, this is inadequate.

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%, so the schema already documents both parameters (json and spaceDid) with clear descriptions. The description doesn't add any meaningful parameter semantics beyond what's in the schema. It mentions space-related concepts but doesn't clarify parameter usage, interactions, or provide examples. The baseline of 3 is appropriate when the schema does the heavy lifting.

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

Purpose2/5

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

The description states 'Tool for w3_space_info operation' which is essentially a tautology that restates the tool name. While it mentions checking login status and handling empty space scenarios, it doesn't clearly articulate what the tool actually does (e.g., retrieve information about a Web3 storage space). The name suggests it gets space information, but the description doesn't confirm this with a specific verb+resource statement.

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

Usage Guidelines3/5

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

The description provides some implied usage guidance by mentioning login prerequisites ('first make sure you are logged in') and handling of edge cases ('no current space and no space given' or empty spaces array). However, it doesn't explicitly state when to use this tool versus alternatives like w3_space_ls or w3_space_create, nor does it provide clear context about when this tool is appropriate versus when other space-related tools should be used.

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