w3_can_blob_ls
List and retrieve blobs stored in the current space with pagination support and JSON output format using the MCP IPFS server.
Instructions
Lists blobs stored in the current space.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Opaque cursor string from a previous response for pagination. | |
| json | No | Format output as newline delimited JSON (default: true). | |
| size | No | Desired number of results to return. |
Implementation Reference
- src/tool_handlers.ts:529-553 (handler)The handler function for 'w3_can_blob_ls' that validates input with schema, builds and runs the 'can blob ls' CLI command, processes output based on json flag, and returns structured response.const handleW3CanBlobLs: ToolHandler = async (args) => { const parsed = Schemas.W3CanBlobLsArgsSchema.safeParse(args); if (!parsed.success) throw new Error( `Invalid arguments for w3_can_blob_ls: ${parsed.error.message}` ); const { json, size, cursor } = parsed.data; let command = "can blob ls"; if (json) command += " --json"; if (size) command += ` --size ${size}`; if (cursor) command += ` --cursor ${cursor}`; const { stdout } = await runW3Command(command); if (json) { const blobs = parseNdJson(stdout); return { content: [{ type: "text", text: JSON.stringify({ blobs }) }], }; } else { return { content: [ { type: "text", text: JSON.stringify({ output: stdout.trim() }) }, ], }; } };
- src/schemas.ts:194-214 (schema)Zod schema for input validation of 'w3_can_blob_ls' tool arguments: optional json (default true), size, cursor.export const W3CanBlobLsArgsSchema = z .object({ json: z .boolean() .optional() .default(true) .describe("Format output as newline delimited JSON (default: true)."), size: z .number() .int() .positive() .optional() .describe("Desired number of results to return."), cursor: z .string() .optional() .describe( "Opaque cursor string from a previous response for pagination." ), }) .describe("Lists blobs stored in the current space.");
- src/tool_handlers.ts:963-963 (registration)Maps the tool name 'w3_can_blob_ls' to its handler function in the toolHandlers export.w3_can_blob_ls: handleW3CanBlobLs,