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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the absolute path requirement for file arguments, which is useful operational context. However, it doesn't describe what the tool actually creates (a delegation CAR file), what permissions are needed, whether this is a write operation, or what happens after creation. The description is insufficient for a tool that appears to create security delegations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences. The first sentence is redundant (tautology), but the second provides valuable constraint information. While under-specified, it's not verbose or poorly structured.

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?

For a tool that creates security delegations with 6 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what a delegation is, what the CAR file contains, how it should be used, or what the tool returns. The absolute path requirement is helpful but insufficient for understanding this complex operation.

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 all parameters are documented in the schema. The description adds the absolute path requirement for the 'output' parameter, which provides additional context beyond the schema's description. However, it doesn't explain the relationship between parameters or the overall delegation creation process.

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 'Tool for w3_delegation_create operation' is a tautology that merely restates the tool name. It adds 'Requires ABSOLUTE paths for file arguments' which is a constraint but doesn't explain what the tool actually does. The name suggests it creates a delegation, but the description fails to specify what resource is being delegated or to whom.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like w3_delegation_ls or w3_delegation_revoke. The description mentions a constraint about absolute paths, but this is a technical requirement rather than usage context. There's no indication of prerequisites, typical scenarios, or relationship to sibling tools.

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