Skip to main content
Glama

w3_delegation_create

Create delegations for specific capabilities on the MCP-IPFS server. Specify audience DID, capabilities, and output path to generate a CAR file or base64 identity CID.

Instructions

Tool for w3_delegation_create operation. Requires ABSOLUTE paths for file arguments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audienceDidYesThe DID of the audience receiving the delegation (e.g., did:key:...).
base64NoFormat output as base64 identity CID string instead of writing to a file.
capabilitiesYesOne or more capabilities to delegate (e.g., ['space/*', 'upload/*']).
nameNoHuman-readable name for the audience.
outputNoABSOLUTE path of file to write the exported delegation CAR file to.
typeNoType of the audience.

Implementation Reference

  • The main handler function `handleW3DelegationCreate` that validates input arguments, constructs and executes the `w3 delegation create` CLI command using `runW3Command`, and formats the response.
    const handleW3DelegationCreate: ToolHandler = async (args) => { const parsed = Schemas.W3DelegationCreateArgsSchema.safeParse(args); if (!parsed.success) throw new Error( `Invalid arguments for w3_delegation_create: ${parsed.error.message}` ); const { audienceDid, capabilities, name: delName, type, output: outFile, base64, } = parsed.data; let command = `delegation create ${audienceDid}`; capabilities.forEach((cap) => { command += ` --can '${cap}'`; }); if (delName) command += ` --name "${delName}"`; if (type) command += ` --type ${type}`; if (outFile) command += ` --output "${outFile}"`; if (base64) command += ` --base64`; const { stdout } = await runW3Command(command); const message = base64 ? "Delegation created successfully (base64 output)." : `Delegation created successfully (output file: ${outFile}).`; return { content: [ { type: "text", text: JSON.stringify({ message: message, output: stdout.trim() }), }, ], }; };
  • Zod schema `W3DelegationCreateArgsSchema` defining and validating the input parameters for the tool, used in handler and dynamically for tool metadata.
    export const W3DelegationCreateArgsSchema = z.object({ audienceDid: z .string() .describe( "The DID of the audience receiving the delegation (e.g., did:key:...)." ), capabilities: z .array(z.string()) .min(1) .describe( "One or more capabilities to delegate (e.g., ['space/*', 'upload/*'])." ), name: z.string().optional().describe("Human-readable name for the audience."), type: z .enum(["device", "app", "service"]) .optional() .describe("Type of the audience."), output: z .string() .optional() .describe( "ABSOLUTE path of file to write the exported delegation CAR file to." ), base64: z .boolean() .optional() .default(false) .describe( "Format output as base64 identity CID string instead of writing to a file." ), });
  • Registration of the `handleW3DelegationCreate` handler in the `toolHandlers` map, which is imported and used in `index.ts` to dispatch tool calls.
    w3_delegation_create: handleW3DelegationCreate,

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