w3_delegation_revoke
Revoke a specific delegation by CID using this MCP IPFS tool. Ensure the input includes the delegation CID and absolute file path for required proofs, facilitating controlled access management in storacha.network spaces.
Instructions
Tool for w3_delegation_revoke operation. Requires ABSOLUTE paths for file arguments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delegationCid | Yes | The CID of the delegation to revoke. | |
| proof | No | ABSOLUTE path to a file containing the delegation and any additional proofs needed. |
Implementation Reference
- src/tool_handlers.ts:311-332 (handler)The main handler function that implements the tool logic: parses arguments using the schema, constructs and executes the 'w3 delegation revoke' CLI command, and formats the response.const handleW3DelegationRevoke: ToolHandler = async (args) => { const parsed = Schemas.W3DelegationRevokeArgsSchema.safeParse(args); if (!parsed.success) throw new Error( `Invalid arguments for w3_delegation_revoke: ${parsed.error.message}` ); const { delegationCid, proof } = parsed.data; let command = `delegation revoke ${delegationCid}`; if (proof) command += ` --proof "${proof}"`; const { stdout } = await runW3Command(command); return { content: [ { type: "text", text: JSON.stringify({ message: `Successfully revoked delegation ${delegationCid}.`, output: stdout.trim(), }), }, ], }; };
- src/schemas.ts:134-142 (schema)Zod schema defining the input arguments for the tool: delegationCid (required) and proof (optional file path).export const W3DelegationRevokeArgsSchema = z.object({ delegationCid: z.string().describe("The CID of the delegation to revoke."), proof: z .string() .optional() .describe( "ABSOLUTE path to a file containing the delegation and any additional proofs needed." ), });
- src/tool_handlers.ts:957-957 (registration)Maps the tool name 'w3_delegation_revoke' to its handler function in the toolHandlers export used by the MCP server.w3_delegation_revoke: handleW3DelegationRevoke,
- src/index.ts:83-88 (registration)Dynamic registration of the tool in ListTools handler, deriving name, description, and inputSchema from imported schemas. The tool name appears in special handling logic around line 74.return { name: toolName, description: description.trim(), inputSchema: zodToJsonSchema(schema) as ToolInputSchema, }; });