request_intro
Propose an introduction to a matched contact through mutual approval. Send a message explaining the value, requiring both parties to consent before connecting.
Instructions
Propose an introduction to someone you matched with. They'll see your message and can approve or decline. Nothing happens without both sides saying yes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match_id | Yes | Match ID from search_matches | |
| to | Yes | Agent ID of the person you want to meet | |
| message | Yes | Short message explaining why this intro would be valuable |
Implementation Reference
- src/index.ts:207-238 (handler)Handler function that executes the request_intro tool logic. Makes POST request to /api/intros endpoint with match details, agent credentials, and cryptographic signature. Returns intro ID and pending status on success, or error message on failure.
async (args) => { try { const result = await api("/api/intros", { method: "POST", body: JSON.stringify({ matchId: args.match_id, targetAgentId: args.to, message: args.message, fieldsToDisclose: ["needs", "offers"], agentId, publicKey: keys.publicKey, signature: sign(args.match_id + args.message, keys.privateKey), }), }); if (result.error) return { content: [{ type: "text" as const, text: `Failed: ${result.error}` }], isError: true }; return { content: [{ type: "text" as const, text: JSON.stringify({ introId: result.introId, status: "pending", to: args.to, note: "Intro request sent. They'll see it in their digest.", }, null, 2), }], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true }; } } - src/index.ts:202-206 (schema)Input schema defining three required string parameters: match_id (from search results), to (target agent ID), and message (explanation for the intro).
{ match_id: z.string().describe("Match ID from search_matches"), to: z.string().describe("Agent ID of the person you want to meet"), message: z.string().describe("Short message explaining why this intro would be valuable"), }, - src/index.ts:199-239 (registration)Complete tool registration calling server.tool() with name 'request_intro', description, input schema, and handler function. Registers the tool with the MCP server.
server.tool( "request_intro", "Propose an introduction to someone you matched with. They'll see your message and can approve or decline. Nothing happens without both sides saying yes.", { match_id: z.string().describe("Match ID from search_matches"), to: z.string().describe("Agent ID of the person you want to meet"), message: z.string().describe("Short message explaining why this intro would be valuable"), }, async (args) => { try { const result = await api("/api/intros", { method: "POST", body: JSON.stringify({ matchId: args.match_id, targetAgentId: args.to, message: args.message, fieldsToDisclose: ["needs", "offers"], agentId, publicKey: keys.publicKey, signature: sign(args.match_id + args.message, keys.privateKey), }), }); if (result.error) return { content: [{ type: "text" as const, text: `Failed: ${result.error}` }], isError: true }; return { content: [{ type: "text" as const, text: JSON.stringify({ introId: result.introId, status: "pending", to: args.to, note: "Intro request sent. They'll see it in their digest.", }, null, 2), }], }; } catch (e: any) { return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true }; } } ); - src/index.ts:19-30 (helper)Helper function that wraps fetch API calls with required headers including agent ID and public key for authentication. Used by the request_intro handler to communicate with the backend API.
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(); }