Skip to main content
Glama

w3_can_upload_ls

Retrieve detailed upload listings for the current space, including pagination and structured output options, using advanced JSON formatting.

Instructions

Lists uploads registered in the current space (advanced view, shows underlying structure).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoOpaque cursor string from a previous response for pagination.
jsonNoFormat output as newline delimited JSON (default: true).
preNoReturn the page of results preceding the cursor.
shardsNoPretty print with shards in output (ignored if --json is true).
sizeNoDesired number of results to return.

Implementation Reference

  • The main handler function that executes the tool logic: parses input arguments using the schema, constructs the 'w3 can upload ls' CLI command based on flags (json, shards, size, cursor, pre), runs it via runW3Command utility, parses output as NDJSON if json=true, and formats the response as MCP tool content.
    const handleW3CanUploadLs: ToolHandler = async (args) => { const parsed = Schemas.W3CanUploadLsArgsSchema.safeParse(args); if (!parsed.success) throw new Error( `Invalid arguments for w3_can_upload_ls: ${parsed.error.message}` ); const { json, shards, size, cursor, pre } = parsed.data; let command = "can upload ls"; if (json) command += " --json"; if (shards) command += " --shards"; if (size) command += ` --size ${size}`; if (cursor) command += ` --cursor ${cursor}`; if (pre) command += " --pre"; const { stdout } = await runW3Command(command); if (json) { const uploads = parseNdJson(stdout); return { content: [{ type: "text", text: JSON.stringify({ uploads }) }], }; } else { return { content: [ { type: "text", text: JSON.stringify({ output: stdout.trim() }) }, ], }; } };
  • Zod schema defining the input parameters and validation for the w3_can_upload_ls tool, including options like json, shards, size, cursor, pre.
    export const W3CanUploadLsArgsSchema = z .object({ json: z .boolean() .optional() .default(true) .describe("Format output as newline delimited JSON (default: true)."), shards: z .boolean() .optional() .default(false) .describe( "Pretty print with shards in output (ignored if --json is 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." ), pre: z .boolean() .optional() .default(false) .describe("Return the page of results preceding the cursor."), }) .describe( "Lists uploads registered in the current space (advanced view, shows underlying structure)." );
  • Maps the tool name 'w3_can_upload_ls' to its handler function in the toolHandlers export, which is used by index.ts to dispatch CallTool requests.
    w3_can_upload_ls: handleW3CanUploadLs,

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