Skip to main content
Glama
peaka-mcp-server

peaka-mcp-server

Official
by peakacom

peaka_get_table_statistics

Read-only

Retrieve column-level statistics for a Peaka table to estimate distinct-value fractions, improving cardinality estimation and query optimization.

Instructions

Get column-level statistics for a table in the Peaka project. Returns the catalog/schema/table identifiers and a per-column distinctFraction (estimated fraction of distinct values vs total rows), useful for cardinality estimation and query optimization.

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>",
      "schemaName": "<schemaName>",
      "tableName": "<tableName>"
    },
    "name": "peaka_get_table_statistics"
  }
}

Input Schema

NameRequiredDescriptionDefault
catalogIdYesThe 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.
tableNameYes
schemaNameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.15.5
    • addedInput schema / properties / catalogId / description
      Added value: +"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.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description adds real value by disclosing the return shape and clarifying that distinctFraction is an estimate, but it says nothing about cost, latency, staleness, or whether stats require a prior metadata refresh.

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?

Two short paragraphs, purpose front-loaded in the first sentence, with the workflow advice isolated at the end. No filler sentences; the only slight inefficiency is that the projectId guidance reads as generic boilerplate rather than tool-specific behavior.

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?

With no output schema, the description usefully describes what comes back, which is the main gap it needs to fill for a read-only statistics tool. The remaining shortfall is the undocumented tableName/schemaName parameters, which neither schema nor description clarify.

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 coverage is only 50%: catalogId carries a rich description while tableName and schemaName have none, and the description does not compensate by explaining identifier formats or quoting rules. The description adds only the observation that identifiers are echoed back in the result, not new meaning for the required inputs. Baseline 3 for a partially documented 4-parameter tool.

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?

States a specific verb and resource: 'Get column-level statistics for a table in the Peaka project,' and further specifies the returned payload (catalog/schema/table identifiers plus per-column distinctFraction). It is clearly distinguishable from listing tools like peaka_list_columns, though it never names a sibling to contrast against.

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?

Gives concrete prerequisite guidance for projectId ('call peaka_list_projects first and ask the user which project to use') and states the analytical use case (cardinality estimation, query optimization). However, it offers no guidance on when to prefer this over peaka_list_table_metadata or peaka_list_columns, nor any exclusions.

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