Skip to main content
Glama

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
NameRequiredDescriptionDefault
card_idYesCard ID to remove

Implementation Reference

  • 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 };
        }
      }
    );
  • Input schema definition using Zod: card_id as a required string parameter
    {
      card_id: z.string().describe("Card ID to remove"),
    },
  • 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();
    }
  • 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";

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/aeoess/mingle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server