Skip to main content
Glama

search_matches

Find relevant people on the Mingle network by matching your needs with their offers and vice versa, returning ranked results based on alignment.

Instructions

Find people relevant to you on the Mingle network. Returns ranked matches based on how well your needs align with their offers and vice versa.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_scoreNoMinimum relevance score (default: 0)
max_resultsNoMax results (default: 10)

Implementation Reference

  • The handler function for search_matches tool that executes the core logic: constructs query parameters, makes API call to /api/matches/{agentId}, handles errors, and returns formatted JSON response with match results including matchId, person, score, mutual status, and explanation.
    async (args) => {
      try {
        const params = new URLSearchParams();
        if (args.min_score) params.set("minScore", String(args.min_score));
        if (args.max_results) params.set("max", String(args.max_results));
        const result = await api(`/api/matches/${agentId}?${params}`);
    
        if (result.error) return { content: [{ type: "text" as const, text: result.error }], isError: true };
    
        return {
          content: [{
            type: "text" as const,
            text: JSON.stringify({
              matchCount: result.matchCount,
              totalPeople: result.totalCandidates,
              matches: (result.matches || []).map((m: any) => ({
                matchId: m.matchId,
                person: m.agentA === agentId ? m.agentB : m.agentA,
                score: m.score,
                mutual: m.mutual,
                explanation: m.explanation,
              })),
            }, null, 2),
          }],
        };
      } catch (e: any) {
        return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true };
      }
    }
  • Input schema definition for search_matches using Zod validation. Defines two optional parameters: min_score (number) for minimum relevance score filtering, and max_results (number) to limit the number of results returned.
    {
      min_score: z.number().optional().describe("Minimum relevance score (default: 0)"),
      max_results: z.number().optional().describe("Max results (default: 10)"),
    },
  • src/index.ts:115-151 (registration)
    Registration of the search_matches tool with the MCP server using server.tool(). Includes the tool name, description, input schema, and handler function.
    server.tool(
      "search_matches",
      "Find people relevant to you on the Mingle network. Returns ranked matches based on how well your needs align with their offers and vice versa.",
      {
        min_score: z.number().optional().describe("Minimum relevance score (default: 0)"),
        max_results: z.number().optional().describe("Max results (default: 10)"),
      },
      async (args) => {
        try {
          const params = new URLSearchParams();
          if (args.min_score) params.set("minScore", String(args.min_score));
          if (args.max_results) params.set("max", String(args.max_results));
          const result = await api(`/api/matches/${agentId}?${params}`);
    
          if (result.error) return { content: [{ type: "text" as const, text: result.error }], isError: true };
    
          return {
            content: [{
              type: "text" as const,
              text: JSON.stringify({
                matchCount: result.matchCount,
                totalPeople: result.totalCandidates,
                matches: (result.matches || []).map((m: any) => ({
                  matchId: m.matchId,
                  person: m.agentA === agentId ? m.agentB : m.agentA,
                  score: m.score,
                  mutual: m.mutual,
                  explanation: m.explanation,
                })),
              }, null, 2),
            }],
          };
        } catch (e: any) {
          return { content: [{ type: "text" as const, text: `Network error: ${e.message}` }], isError: true };
        }
      }
    );
  • Helper function 'api' used by search_matches handler to make HTTP requests. Adds authentication headers (X-Agent-Id, X-Public-Key) and returns JSON response from the Mingle 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();
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that matches are 'ranked' and based on 'how well your needs align with their offers and vice versa,' which adds some context about the algorithm. However, it lacks details on permissions, rate limits, data sources, or what constitutes a 'match' beyond alignment, leaving significant gaps for a discovery tool.

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

Conciseness5/5

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

The description is concise and front-loaded, consisting of two sentences that efficiently convey the tool's purpose and key behavior. Every sentence adds value without redundancy, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (discovery with ranking), no annotations, no output schema, and 100% schema coverage, the description is minimally adequate. It explains what the tool does but lacks details on return format, error handling, or deeper behavioral traits, which could hinder an agent's ability to use it effectively without trial and error.

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?

The input schema has 100% description coverage, with parameters min_score and max_results clearly documented. The description doesn't add any additional meaning beyond what the schema provides, such as explaining how 'min_score' relates to relevance or typical values. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Find people relevant to you on the Mingle network' with the specific action of returning ranked matches based on mutual alignment of needs and offers. It distinguishes itself from siblings like get_digest or request_intro by focusing on discovery rather than interaction or summary, though it doesn't explicitly name alternatives.

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

Usage Guidelines3/5

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

The description implies usage for finding relevant people when alignment of needs and offers is important, but it doesn't provide explicit guidance on when to use this tool versus alternatives like request_intro or get_digest. No exclusions or prerequisites are mentioned, leaving usage context somewhat open-ended.

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

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