Skip to main content
Glama
dalboki

sonsuchup-mcp

by dalboki

add_edge

Add a relationship between two persons in a mystery case. Provide local IDs of the persons and a label for the relationship.

Instructions

두 인물 사이 관계를 추가합니다. from/to는 인물의 local id. label 예: "친구", "직장 동료", "부부".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseIdYes
fromYes
toYes
labelNo

Implementation Reference

  • src/tools.ts:275-300 (registration)
    The 'add_edge' tool is defined as an entry in the `tools` array exported from src/tools.ts. It includes name, description, inputSchema, and the handler function.
    {
      name: 'add_edge',
      description:
        '두 인물 사이 관계를 추가합니다. from/to는 인물의 local id. label 예: "친구", "직장 동료", "부부".',
      inputSchema: z.object({
        caseId: z.string().uuid(),
        from: z.number().int(),
        to: z.number().int(),
        label: z.string().optional(),
      }),
      handler: async (input: { caseId: string; from: number; to: number; label?: string }) => {
        const c = await fetchCase(input.caseId);
        const ids = new Set(c.people.map((p) => p.id));
        if (!ids.has(input.from)) throw new Error(`from 인물(${input.from})이 존재하지 않습니다.`);
        if (!ids.has(input.to)) throw new Error(`to 인물(${input.to})이 존재하지 않습니다.`);
        const localId = nextLocalId(c.edges);
        c.edges.push({
          id: localId,
          from: input.from,
          to: input.to,
          label: input.label ?? '',
        });
        await saveCase(c);
        return { localId, url: caseUrl(input.caseId) };
      },
    },
  • The handler function for 'add_edge': fetches the case data, validates that both 'from' and 'to' person IDs exist, creates a new edge with nextLocalId, pushes it to c.edges, saves the case, and returns the new localId and case URL.
    handler: async (input: { caseId: string; from: number; to: number; label?: string }) => {
      const c = await fetchCase(input.caseId);
      const ids = new Set(c.people.map((p) => p.id));
      if (!ids.has(input.from)) throw new Error(`from 인물(${input.from})이 존재하지 않습니다.`);
      if (!ids.has(input.to)) throw new Error(`to 인물(${input.to})이 존재하지 않습니다.`);
      const localId = nextLocalId(c.edges);
      c.edges.push({
        id: localId,
        from: input.from,
        to: input.to,
        label: input.label ?? '',
      });
      await saveCase(c);
      return { localId, url: caseUrl(input.caseId) };
    },
  • Input schema for 'add_edge': requires caseId (UUID string), from (int), to (int), and optional label (string). Validated with Zod.
    inputSchema: z.object({
      caseId: z.string().uuid(),
      from: z.number().int(),
      to: z.number().int(),
      label: z.string().optional(),
    }),
  • EdgeData type definition: { id: number; from: number; to: number; label: string } used for the edge objects.
    type EdgeData = { id: number; from: number; to: number; label: string };
  • nextLocalId helper: computes the next ID by finding the max existing ID + 1.
    function nextLocalId(items: { id: number }[]): number {
      return items.reduce((max, it) => Math.max(max, it.id ?? 0), 0) + 1;
    }
Behavior2/5

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

With no annotations, the description must disclose behavior. It only says 'adds a relationship' but does not mention side effects (e.g., creates records), error conditions, authorization, or idempotency. This is minimal disclosure for a mutation 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?

Two short, clear sentences with no extraneous information. The description is appropriately sized and front-loaded with the core purpose.

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

Completeness2/5

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

Given the domain (cases, persons), the description lacks context about the caseId parameter and how edges relate to existing data. No output schema, so the agent doesn't know what to expect. The description is insufficient for a complete understanding of the tool's function.

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 description explains the 'from' and 'to' parameters as local IDs and gives label examples, adding value beyond the schema. However, it fails to explain the 'caseId' parameter, which is crucial for the context. Schema coverage is 0%, so the description partially compensates but remains incomplete.

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 verb 'adds' and the resource 'relationship between two people', distinguishing this from other tools like add_person or add_alibi. However, it does not explicitly differentiate from siblings or provide scope. It is specific enough for basic understanding.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, nor any prerequisites or constraints. The description only provides label examples but omits context like required existing persons or case setup. The agent lacks direction for appropriate invocation.

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/dalboki/sonsuchup-mcp'

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