w3_can_store_ls
Lists stored CAR files (shards) within the current space using pagination and JSON output for advanced data management on MCP-IPFS servers.
Instructions
Lists stored CAR files (shards) in the current space (advanced use).
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:854-878 (handler)The main handler function for the 'w3_can_store_ls' tool. Parses input arguments, constructs the 'can store ls' CLI command with optional --json, --size, --cursor flags, executes it via runW3Command, processes output (parsing NDJSON if json flag), and returns structured content.const handleW3CanStoreLs: ToolHandler = async (args) => { const parsed = Schemas.W3CanStoreLsArgsSchema.safeParse(args); if (!parsed.success) throw new Error( `Invalid arguments for w3_can_store_ls: ${parsed.error.message}` ); const { json, size, cursor } = parsed.data; let command = "can store ls"; if (json) command += " --json"; if (size) command += ` --size ${size}`; if (cursor) command += ` --cursor ${cursor}`; const { stdout } = await runW3Command(command); if (json) { const stores = parseNdJson(stdout); return { content: [{ type: "text", text: JSON.stringify({ stores }) }], }; } else { return { content: [ { type: "text", text: JSON.stringify({ output: stdout.trim() }) }, ], }; } };
- src/schemas.ts:357-379 (schema)Zod schema defining input arguments for the w3_can_store_ls tool: optional json (default true), size (positive int), cursor (string).export const W3CanStoreLsArgsSchema = 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 stored CAR files (shards) in the current space (advanced use)." );
- src/tool_handlers.ts:976-976 (registration)Registration of the handleW3CanStoreLs function to the 'w3_can_store_ls' key in the toolHandlers export map.w3_can_store_ls: handleW3CanStoreLs,