Skip to main content
Glama
peaka-mcp-server

peaka-mcp-server

Official
by peakacom

peaka_get_relations

Read-only

Retrieve table relationships and foreign keys for a Peaka catalog to understand how tables connect and build accurate JOIN conditions instead of guessing from column-name similarity.

Instructions

Get table relationships (foreign keys) for a catalog in the Peaka project. Useful for understanding how tables connect when constructing JOINs — without this, JOIN conditions have to be guessed from column-name similarity. The response is an open-ended object map keyed by relation identifier.

If you do not already know the projectId for the current task, call peaka_list_projects first and ask the user which project to use. Remember the chosen projectId for subsequent calls in this conversation.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>",
      "catalogId": "<catalogId>"
    },
    "name": "peaka_get_relations"
  }
}

Input Schema

NameRequiredDescriptionDefault
catalogIdYesWhose relationships to return. The catalog's id, or its name as written in SQL (e.g. "stripe" in stripe.payment.charges). "peaka" with schemaName query or mtquery is the saved queries, with any other schema the Peaka tables.
projectIdYesThe Peaka project ID to run against.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.15.5
    • changedInput schema / properties / catalogId / description
      Previous value: -"The catalog ID whose relationships should be returned."New value: +"Whose relationships to return. The catalog's id, or its name as written in SQL (e.g. \"stripe\" in stripe.payment.charges). \"peaka\" with schemaName query or mtquery is the saved queries, with any other schema the Peaka tables."
  2. First observedv0.11.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuine value by disclosing the return shape ('open-ended object map keyed by relation identifier') and the reason the data matters. However, it does not cover empty results, relation-scope limits, or whether relations require a metadata refresh first.

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

Conciseness4/5

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

Front-loaded with the core action and value proposition in the first two sentences. The third sentence about projectId is procedural but earns its place as a required prerequisite. A small amount of redundancy between the title and the verb phrase.

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

Completeness4/5

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

For a two-parameter read-only tool with fully documented schema, the definition covers purpose, use case, prerequisite workflow, and return type. Minor gaps remain around behavior when no relations exist or whether results depend on metadata state, which matters since there is no output schema.

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?

Schema description coverage is 100%, and the catalogId schema text is already richer than the description (name-as-in-SQL, 'peaka' with schemaName query/mtquery semantics). The description adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Get table relationships (foreign keys) for a catalog') plus the scope ('for a catalog in the Peaka project'). The parenthetical clarifies the underlying data (foreign keys), so an agent can distinguish this from table/column listing siblings without opening the schema.

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

Usage Guidelines4/5

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

Gives a clear use case ('understanding how tables connect when constructing JOINs') and a concrete prerequisite: call peaka_list_projects first when projectId is unknown, then confirm with the user. It stops short of stating when NOT to use it (e.g., vs. peaka_list_columns or table statistics), so no explicit exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.