Skip to main content
Glama
kmsmohamedansar

mcp-analytics-stub

mcp-analytics-stub

A minimal Model Context Protocol server in TypeScript. It exposes two tools over stdio and returns synthetic data only. It exists to show the shape of an MCP server that wraps an analytics API, without wrapping a real one.

Tools

Tool

Kind

What it does

resolve_category

resolver

Turns a name fragment into stable category ids.

get_insights

context

Given an id, returns a few insight rows. Unknown ids return an error result.

Related MCP server: mcp-production-mastery

Shape

MCP client (IDE agent)
   │  JSON-RPC over stdio
   ▼
MCP server  ── zod validation ──▶ resolver / context handlers ──▶ data layer

In a real server the data layer would be an HTTPS client, with credentials read from environment variables. Here it is an in-memory list.

Why these two tool kinds

  • Resolvers map human names to ids, so the agent never has to guess an identifier.

  • Context tools take an id and return structured data, so answers come from a call rather than from pasted text.

  • Inputs are schema-validated, so a malformed call fails loudly.

  • Tool descriptions matter: they are what an agent reads when choosing a tool.

Run it

npm install
npm test
npm run dev        # stdio server

To use it from an MCP-capable editor, point it at npx tsx src/server.ts (or node dist/server.js after npm run build) as a stdio server.

From local to shared

The same handlers can sit behind a stateless HTTP transport in a container for team use. This stub keeps stdio only, to stay small.

License

MIT. All data is invented.

Available Tools

2 tools
get_insightsC

Return top insights for a category id from resolve_category.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
category_idYesAn id returned by resolve_category

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and discloses almost nothing: it does not say the operation is read-only, whether results are ranked by what ('top' is unexplained), whether the call can fail or return empty, or anything about permissions. 'Top' hints at ordering but leaves the ordering key unspecified.

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?

A single short sentence with zero filler and the key dependency front-loaded. The terseness borders on under-specification, but as a conciseness measure it is efficient and well-structured.

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?

For a tool with no annotations, no output schema, and an undocumented second parameter, the description is too thin: an agent gets no return-shape, no ordering semantics, and no behavior on empty results. The dependency on resolve_category is the only substantive context supplied.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 50%: category_id is documented in the schema and merely restated by the description, while the limit parameter (default 3, max 10, min 1) is undocumented in both places. With a sub-50% coverage gap, the description needed to compensate for limit and did not.

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 ('Return') and resource ('top insights') scoped to a category id, and names resolve_category as the source of that id, which distinguishes it from its only sibling. However, 'insights' is never defined, so the agent knows the shape of the operation but not really what an insight is.

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 phrase 'for a category id from resolve_category' implies the prerequisite that resolve_category must be called first, which is useful chaining guidance. It offers no when-to-use vs when-not guidance, no exclusions, and no indication of what to do if the category has no insights.

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

resolve_categoryA

Find categories whose name contains the query. Returns ids to use with other tools.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesPart of a category name

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does disclose the return contract ('Returns ids to use with other tools'), which is genuinely useful chaining context. It omits matching behavior details such as case sensitivity, result caps, or ordering, which an agent would want for a search 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 sentences, zero filler, purpose front-loaded ahead of the return-value note. Nothing is wasted and nothing important is buried.

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 single-parameter resolver with no output schema, the description covers what it does and what it returns, which is sufficient to call it correctly. Minor gaps remain around result-set behavior (multiple matches, limits), which matter for a search-style tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already describes the parameter as 'Part of a category name', so baseline would be 3. The description adds the substring-matching semantics ('name contains the query'), clarifying it is a contains-search rather than prefix or exact match, which is real added meaning.

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+resource ('Find categories') and adds the matching rule ('whose name contains the query'), so an agent knows exactly what it does. It doesn't differentiate from the only sibling, get_insights, but that sibling is clearly unrelated in purpose.

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?

Usage is implied by the text – this is the tool to call when you have a partial category name and need the canonical id. There is no explicit when/when-not guidance, no note about ambiguity or multiple matches, and no stated alternative for exact-name lookups.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observedget_insights
    • First observedresolve_category

TDQS

B3.4/5.0

Scored across 2 tools

Disambiguation5/5

resolve_category and get_insights target clearly different stages of the workflow (discovery vs. retrieval), and the descriptions explicitly explain the handoff via category ids. There is no overlap that could cause misselection.

Naming Consistency5/5

Both tools follow a consistent verb_noun snake_case pattern. The convention is applied uniformly with no mixed styles or casing deviations.

Tool Count3/5

Two tools is thin but the stub scope (resolve a category, fetch its insights) is plausibly minimal. It sits at the borderline where an agent may need more surface for real work.

Completeness3/5

Coverage is a narrow two-step path: discovery requires a query string with no way to list all categories, and there is no pagination, time range, or drill-down beyond 'top insights'. Core workflow works but obvious gaps remain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides two MCP tools for querying a synthetic marketing SQLite database and running agent evaluation cases, with read-only SQL guarding and deterministic planning. The server communicates over stdio and supports initialization handshake and tool listing.
    -
  • F
    license
    B
    quality
    C
    maintenance
    Provides a stdio MCP server with strict input validation and JSON-RPC error handling for tool calls.
    2
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP-aware clients to query and use the you-design catalog of design systems, skills, and plugins at runtime via stdio.
    -