remove_intent_card
Remove your networking card from the Mingle MCP server when your needs change, allowing you to publish a new one when ready.
Instructions
Remove your card from the network. Use when your situation changed. Publish a new one when ready.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes | Card ID to remove |
Implementation Reference
- src/index.ts:294-318 (handler)The handler function for remove_intent_card tool that deletes a card from the network via API call, signing the request with the agent's private key
async (args) => { try { const result = await api(`/api/cards/${args.card_id}`, { method: "DELETE", body: JSON.stringify({ agentId, publicKey: keys.publicKey, signature: sign(args.card_id, keys.privateKey), }), }); return { content: [{ type: "text" as const, text: JSON.stringify({ removed: result.removed || false, cardId: args.card_id, error: result.error, }, null, 2), }], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true }; } } - src/index.ts:288-319 (registration)Registration of the remove_intent_card tool using server.tool() with name, description, schema, and handler function
server.tool( "remove_intent_card", "Remove your card from the network. Use when your situation changed. Publish a new one when ready.", { card_id: z.string().describe("Card ID to remove"), }, async (args) => { try { const result = await api(`/api/cards/${args.card_id}`, { method: "DELETE", body: JSON.stringify({ agentId, publicKey: keys.publicKey, signature: sign(args.card_id, keys.privateKey), }), }); return { content: [{ type: "text" as const, text: JSON.stringify({ removed: result.removed || false, cardId: args.card_id, error: result.error, }, null, 2), }], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true }; } } ); - src/index.ts:291-293 (schema)Input schema definition using Zod: card_id as a required string parameter
{ card_id: z.string().describe("Card ID to remove"), }, - src/index.ts:19-30 (helper)Helper function 'api' that makes authenticated HTTP requests to the Mingle API with agent headers
async function api(path: string, opts?: RequestInit): Promise<any> { const res = await fetch(`${API}${path}`, { ...opts, headers: { "Content-Type": "application/json", "X-Agent-Id": agentId, "X-Public-Key": keys.publicKey, ...opts?.headers, }, }); return res.json(); } - src/index.ts:8-11 (helper)Imports including 'sign' function from agent-passport-system used for cryptographic signing of requests
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { generateKeyPair, createIntentCard, sign } from "agent-passport-system";