Skip to main content
Glama
CrownJoker07

thinkingdata-readonly

by CrownJoker07

thinkingdata-mcp

ThinkingData 5.0 的本地只读 MCP Server。服务端稳定名称为 thinkingdata-readonly,首版只通过 stdio 运行,仅暴露 10 个面向用户目标的 只读工具。

当前状态:首版 10 个只读 tools、stdio 入口、HTTP 客户端、API 映射和基础测试已实现。

安装与运行

项目要求 Node.js 18 或更高版本。依赖只安装在当前项目中:

npm ci
npm run build

配置必填环境变量并启动:

export THINKINGDATA_BASE_URL="https://your-thinkingdata-host"
export THINKINGDATA_PROJECT_ID="your-project-id"
export THINKINGDATA_QUERY_TOKEN="your-query-token"
npm start

质量检查:

npm run typecheck
npm test
npm run build

Related MCP server: telemetry-mcp

设计原则

  • Tool 对应用户要完成的目标,不机械复制 ThinkingData 内部 API。

  • 读取与写入能力分离;首版没有写入能力,也没有通用 call_api 后门。

  • 参数使用业务化、窄而明确的 schema;不会接收任意官方请求 JSON。

  • 凭据只在 HTTP 客户端层读取,不是 tool 参数,不进入返回值或日志。

  • 只实现本地 stdio;不实现缓存、重试、持久化、远程 HTTP、OAuth、Plugin UI 或自动抓取文档。

  • ThinkingData API 的字段、枚举和限制以固定版本 5.0 的官方文档为准,并记录在 docs/api-mapping.yaml

  • 本服务只提供 MCP tools,不提供 resources;事件和属性元数据分别通过 list_event_metadatalist_property_metadata 获取。

这些选择遵循 OpenAI 的建议:tool 应帮助完成一个用户目标,相关操作组成一个连贯 动作,而权限、风险或确认要求不同的操作应拆开。完整 contract 应明确名称、描述、 输入与输出 schema、授权、副作用和失败行为。

MCP 官方推荐格式

MCP tool 通过 tools/list 暴露,通过 tools/call 调用。一个完整 tool 定义应包含:

{
  "name": "query_event_analysis",
  "title": "查询事件分析",
  "description": "当用户需要按指标、时间粒度、筛选或分组分析事件时使用。",
  "inputSchema": {
    "type": "object",
    "properties": {},
    "required": [],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "properties": {},
    "required": [],
    "additionalProperties": false
  },
  "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "openWorldHint": false
  }
}

本项目使用 Zod 定义输入与输出 schema,由官方 MCP TypeScript SDK 导出 JSON Schema。outputSchema 一旦声明,服务端返回的 structuredContent 必须符合它。 同时返回简短 content,便于模型直接组织回答并兼容只消费 MCP content 的客户端:

{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"source\": { ... },\n  \"return_code\": 0,\n  \"return_message\": \"success\",\n  \"data\": {}\n}"
    }
  ],
  "structuredContent": {
    "source": {
      "document_version": "5.0",
      "documentation_url": "https://docs-v2.thinkingdata.cn/?version=v5.0&lan=zh-CN&code=event_query_api&anchorId=",
      "endpoint": "/actual/endpoint"
    },
    "return_code": 0,
    "return_message": "success",
    "data": {}
  }
}

说明:

  • name 使用稳定、可读、action-oriented 的标识符。

  • description 说明用户目标以及何时选择该工具,用于提高模型选取准确率。

  • inputSchema 明确必填项、类型、枚举、互斥关系和限制。

  • outputSchema 描述可复用的结构化结果。

  • 为兼容不展示 structuredContent 的 MCP Host,完整结果同时以 JSON 文本写入 content

  • annotations 必须与真实行为一致,不能代替服务端授权和输入校验。

  • 本项目所有工具均为只读,因此使用 readOnlyHint: truedestructiveHint: false。查询会访问配置的 ThinkingData 服务,但不改变其状态。

stdio 约定

stdio 用于由 MCP Host 启动的本地子进程。JSON-RPC 请求从 stdin 进入,响应从 stdout 输出。stdout 是协议专用通道,因此诊断信息只能写入 stderr;任何普通 console.log 都可能破坏协议通信。

服务启动所需的三个环境变量均为必填,不提供隐式默认值:

THINKINGDATA_BASE_URL
THINKINGDATA_PROJECT_ID
THINKINGDATA_QUERY_TOKEN

计划中的 Host 配置格式如下;构建完成后将 <absolute-path> 替换为仓库绝对路径:

{
  "mcpServers": {
    "thinkingdata-readonly": {
      "command": "node",
      "args": ["<absolute-path>/dist/index.js"],
      "env": {
        "THINKINGDATA_BASE_URL": "https://your-thinkingdata-host",
        "THINKINGDATA_PROJECT_ID": "your-project-id",
        "THINKINGDATA_QUERY_TOKEN": "your-query-token"
      }
    }
  }
}

不要把真实 token 提交到仓库;.env 已被忽略。

首版工具

Tool

用户目标

主要参数形态

query_event_analysis

查询事件指标趋势

指标、时间粒度、筛选、分组

query_retention_analysis

查询初始事件后的回访留存

初始事件、回访事件、时间范围、时间粒度、留存期限、筛选

query_funnel_analysis

查询有序步骤转化

有序步骤、转化窗口、筛选

query_distribution_analysis

查询事件指标的分布

事件、指标、时间范围、时间粒度、筛选

query_path_analysis

查询事件间访问路径

事件集合、起点、路径方向、列数、会话窗口

query_interval_analysis

查询两个事件之间的间隔

起始事件、结束事件、时间粒度

query_user_property_analysis

查询用户属性聚合

目标属性、聚合方式

execute_sql_query

执行单条只读 SELECT/WITH … SELECT 查询并返回 JSON

sql

list_event_metadata

列出当前项目事件元数据

无参数

list_property_metadata

列出事件或用户属性元数据

table_type,事件表可带 event_name

共享结构只提取确实重复的概念:绝对或相对时间范围、事件引用、属性引用、筛选条件 和分组属性。每类分析仍保留独立 schema,不用一个泛化结构抹平业务差异。

明确排除:用户列表、全量下载、用户列表下载、SQL 分页、异步 SQL、任务取消、 分群或标签写入、元数据修改、看板管理、用户管理和项目管理。

execute_sql_query 在发送 HTTP 请求前执行保守的只读校验:接受原始 SQL 或单个 Markdown SQL 代码块中的单条 SELECTWITH … SELECT,拒绝分号、SQL 注释以及 写入、DDL、权限变更和过程调用关键字。无法明确判断为只读的 SQL 会被拒绝; ThinkingData 查询 token 仍应在服务端配置为只读权限,作为最终安全边界。

TA SQL 使用双引号引用标识符,不支持反引号。MCP 会在 SQL 工具描述中给出当前配置的 确切事件表 v_event_<projectId> 和用户表 v_user_<projectId>,不要自行缩写表名,也 不要假设存在 default_eventdefault_user;查询前应通过元数据工具确认事件、属性及其数据类型。字符串属性应使用 DISTINCTIS_NOT_EMPTY 等兼容的属性聚合,不能使用 SUMAVG

OpenAI 建议在工具较多时将能力放入描述清楚的 namespace 或 MCP Server,以便模型 只加载相关工具,减少初始上下文占用。本项目把 10 个同一权限边界、同一数据源的 ThinkingData 只读能力放在一个 MCP Server 中;工具描述保持明确,使直接选择和按需 发现都能工作。后续写入能力不会混入当前只读 server contract。

项目布局

thinkingdata-mcp/
├── docs/
│   └── api-mapping.yaml       # ThinkingData 5.0 权威依据矩阵
├── src/
│   ├── index.ts               # stdio 入口
│   ├── server.ts              # MCP Server 创建和 10 个 tool 注册
│   ├── config.ts              # 三个必填环境变量的边界校验
│   ├── client.ts              # ThinkingData HTTP 客户端与凭据隔离
│   ├── schemas/               # 共享结构和各分析独立 schema
│   └── tools/                 # tool 到 HTTP 请求的业务映射
│   ├── fixtures/              # ThinkingData 5.0 官方示例映射 fixture
│   ├── schemas/               # 合法、缺失、非法枚举、互斥范围测试
│   ├── tools/                 # 请求映射、响应和 tool 选择测试
│   └── server.test.ts         # tools/list、annotations 与泄密检查
├── package.json
├── tsconfig.json
└── README.md

目录会随实现落地,但职责边界保持不变;不会为未请求的能力预留抽象层。

权威资料

MCP 官方

OpenAI 官方

ThinkingData 官方

docs/api-mapping.yaml 将对每个 tool 记录官方页面与章节、endpoint、HTTP 方法、 请求与响应字段映射、官方枚举、只读属性、错误码和最后核对日期,只摘录实现必需的 内容,不复制整篇官方文档。

测试要求

  • 10 个 tools 分别覆盖合法 schema、缺失必填项、非法枚举和互斥时间范围。

  • 使用官方示例 fixture 验证 method、path、query 和 body 映射。

  • 使用本地 fake HTTP server 验证成功、非零返回码、非 JSON、HTTP 错误和网络失败。

  • token 不得出现在 MCP 结果、错误、快照或日志中。

  • tools/list 只能暴露上述 10 个工具,并完整验证描述、schema、output schema 和 annotations。

  • 每个 tool 覆盖直接请求、相似工具区分和越界请求三类自然语言选择测试。

  • 最终使用 MCP Inspector 逐个核对代表性、非法和未授权输入。

License

尚未指定。

Available Tools

10 tools
execute_sql_queryB
Read-only

Execute one synchronous SQL query and return JSON results.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds 'synchronous' and 'return JSON results,' which are useful, but it does not explain potential implications like performance, error behavior, or that the query must be read-only. It does not contradict annotations, so this is a moderate score.

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 a single, concise sentence that directly states the tool's action and output. It is well-structured and front-loaded, with no wasted words.

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?

While an output schema exists (so return values are covered), the description lacks essential context for a powerful SQL execution tool. It does not mention the read-only constraint, any limitations, or how it relates to the higher-level analysis tools. Given the potential impact, this is incomplete for an agent to use safely and effectively.

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?

The schema has one parameter 'sql' with 0% schema description coverage. The description merely refers to 'SQL query,' which essentially restates the parameter name and provides no additional meaning such as SQL dialect, allowed statements, or syntax examples. It fails to compensate for the lack of schema descriptions.

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 function: 'Execute one synchronous SQL query and return JSON results.' It identifies a specific verb (execute) and resource (SQL query), and the SQL nature implicitly distinguishes it from the sibling analysis tools. However, it does not explicitly draw that differentiation.

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?

There is no guidance on when to use this tool versus the sibling query_* analysis tools. It does not mention alternatives, prerequisites, or contexts where this tool is appropriate or inappropriate. The description is purely functional without usage direction.

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

list_event_metadataA
Read-only

List event metadata for the configured ThinkingData project.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

A4.1/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, covering the safety profile. The description adds context about the 'configured ThinkingData project' but does not disclose behavioral traits such as pagination, rate limits, or scope of returned metadata. With annotations present, the description adds some value but stays within expected limits.

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 a single, clearly front-loaded sentence with no redundancy or filler. Every word earns its place, and it efficiently communicates the tool's purpose.

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

Completeness5/5

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

Given the tool has zero parameters and an output schema is present, the description is complete enough. It states the resource being listed and the project scope, while return-value details are handled by the output schema. No additional context is necessary for this low-complexity 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?

The tool takes no parameters, and the input schema is an empty object. Per the rubric, 0 params yields a baseline of 4. The description correctly avoids inventing parameters and does not need to explain anything beyond the schema, which is fully covered.

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?

The description uses a specific verb+resource ('List event metadata') and clearly distinguishes from the sibling tool 'list_property_metadata' by focusing on events rather than properties. The qualifier 'for the configured ThinkingData project' provides project scope, making the purpose unambiguous.

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 when event metadata is needed but offers no explicit guidance on when to choose this tool over alternatives like 'list_property_metadata' or the various analysis queries. There is no mention of exclusions or prerequisites, so guidance is minimal beyond the obvious function.

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

list_property_metadataB
Read-only

List event or user property metadata for the configured project.

ParametersJSON Schema
NameRequiredDescriptionDefault
event_nameNo
table_typeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already indicate this is a safe read-only operation (readOnlyHint=true, destructiveHint=false). The description adds the project context but does not disclose any additional behavioral traits such as pagination, filtering behavior, or specific output characteristics. It does not contradict the annotations, but adds minimal behavioral value beyond them.

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 a single concise sentence that is front-loaded with the action and resource, containing no filler or redundant information. Every word adds value.

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?

The tool has a moderate complexity with two parameters and an output schema, but the description leaves the event_name parameter unexplained and offers no usage guidance. While the output schema may cover return values, the incomplete parameter semantics and lack of alternatives make it only minimally complete.

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?

With 0% schema description coverage, the description must compensate by explaining parameters. It only indirectly explains table_type via 'event or user' but completely fails to mention the optional event_name parameter, leaving its purpose and usage ambiguous. This is a significant gap given the schema provides no descriptions.

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?

The description uses the specific verb 'List' and clearly identifies the resource as 'event or user property metadata' for the configured project. This distinguishes it from siblings like list_event_metadata and the various query analysis tools, making its purpose unambiguous.

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?

The description provides no guidance on when to use this tool versus alternatives such as list_event_metadata or query tools. There are no explicit use cases, prerequisites, or exclusions, leaving the agent to infer appropriate usage only from the tool name and description.

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

query_distribution_analysisC
Read-only

Query how an event metric is distributed over a property.

ParametersJSON Schema
NameRequiredDescriptionDefault
eventYes
metricYes
time_rangeYes
distribution_propertyYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

C2.4/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is clear. The description adds no additional behavioral context such as return format, data granularity, or how distribution is computed, offering no value beyond the annotations.

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

Conciseness3/5

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

The description is a single sentence, which is concise, but it is under-specified rather than appropriately concise. It states the core purpose but omits necessary details, so the brevity does not fully serve the agent.

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 tool's complexity (4 required parameters, nested objects, and an output schema) and its sibling tools, the one-sentence description is inadequate. It does not explain what 'distribution' means, how the property is specified, or what the output contains, leaving significant gaps.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain any of the four required parameters. While the schema has meaningful names, the description fails to add any semantic meaning beyond what is in the schema, leaving the agent without guidance on parameter usage.

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 queries how an event metric is distributed over a property, using a specific verb and resource. It is distinguishable from siblings like query_event_analysis by the focus on 'distribution over a property,' though it does not 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 Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as query_event_analysis or query_user_property_analysis. It only states the action without any contextual scenarios or exclusions.

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

query_event_analysisB
Read-only

Query event metrics over time with optional filters and grouping.

ParametersJSON Schema
NameRequiredDescriptionDefault
eventYes
metricYes
filtersNo
group_byNo
time_rangeYes
time_granularityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds behavioral context by specifying the query can be filtered and grouped over time. It does not contradict annotations and provides some value beyond the structured fields.

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 a single concise sentence that is front-loaded with the key action and object. Every word earns its place, and it avoids any redundancy.

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?

Despite having a complex schema with 6 parameters, nested objects, and multiple enums, the output schema is present, but the description remains overly terse. It does not explain what constitutes 'event metrics', how filters/grouping work, or when this tool is preferable to the many sibling analysis tools. The description is insufficient for a tool of this complexity.

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 0%, so the description must compensate for the 6 parameters. It only mentions 'event metrics', 'over time', 'filters', and 'grouping' at a conceptual level, which maps to some parameters but leaves out details on metric types, time_range formats, and granularity. The rich schema with enums and nested objects is not explained, so the description adds little semantic value.

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 queries event metrics over time with optional filters and grouping. It uses a specific verb ('query') and identifies the resource ('event metrics'), but it does not explicitly distinguish itself from sibling analytics tools like query_retention_analysis or query_funnel_analysis, so it misses the top score.

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 querying event metrics over time, but it does not provide explicit guidance on when to use this tool over siblings, nor does it mention any exclusions or prerequisites. There is no reference to alternative tools.

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

query_funnel_analysisB
Read-only

Query conversion across an ordered sequence of event steps.

ParametersJSON Schema
NameRequiredDescriptionDefault
stepsYes
filtersNo
time_rangeYes
conversion_windowYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safe read nature is known. The description adds no additional behavioral context beyond the core concept; it does not contradict annotations, but also does not disclose pagination, ordering requirements, or return characteristics, though output schema covers some of this.

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 a single, front-loaded sentence with no wasted words. It communicates the essential purpose efficiently and is appropriately sized for the tool.

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 tool has four parameters with nested objects and the description provides no parameter semantics, usage guidance, or behavioral disclosure, the description is too thin to be fully useful. While the output schema exists and annotations cover safety, the lack of explanation for key concepts like conversion_window and steps limits completeness.

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

Parameters1/5

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

Schema description coverage is 0%, and the description provides no explanation of the four parameters (steps, filters, time_range, conversion_window) or their semantics. The nested structure and units (e.g., conversion_window) are left entirely to the schema, which does not explain their meaning in the context of funnel analysis.

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 states the tool queries conversion across an ordered sequence of event steps, which is a clear and specific definition of funnel analysis. It distinguishes from sibling tools like retention or path analysis by focusing on sequential conversion, though the verb 'query' is generic.

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?

There is no explicit guidance on when to use this tool versus alternatives like query_path_analysis or query_retention_analysis. The use case is implied by the description (conversion across steps), but no exclusions or alternative recommendations are provided.

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

query_interval_analysisC
Read-only

Query elapsed intervals between a start and end event.

ParametersJSON Schema
NameRequiredDescriptionDefault
end_eventYes
time_rangeYes
start_eventYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

C2.8/5.0
Behavior2/5

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

Annotations indicate a read-only, non-destructive operation, which is consistent with the description. However, the description adds no behavioral context beyond that—it does not explain what an 'elapsed interval' includes, how events are matched, or any limitations.

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 a single sentence with no redundant words, making it very concise and easy to read. It is appropriately front-loaded with the core purpose.

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

Completeness1/5

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

Given the tool has nested parameters and several sibling tools, this description is far too minimal. It lacks details about how the time range options work, the meaning of interval results, and any usage context, leaving significant gaps for the agent.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain any of the three parameters (start_event, end_event, time_range). The schema provides type information but no semantic guidance on how these parameters interact or should be used.

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?

The description clearly states the tool queries elapsed intervals between a start and end event, using a specific verb and resource. This distinguishes it from sibling tools like query_event_analysis or query_retention_analysis.

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 is provided on when to use this tool versus alternative analysis tools. The description does not mention exclusions, prerequisites, or recommended use cases.

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

query_path_analysisC
Read-only

Query paths around a selected starting event.

ParametersJSON Schema
NameRequiredDescriptionDefault
eventsYes
directionYes
time_rangeYes
start_eventYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

C2.7/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description's 'Query' is consistent but adds no additional behavioral context. It does not disclose output format, limits, or any other side effects beyond what the annotations imply, failing to add value beyond the structured data.

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?

The description is a single sentence with no wasted words and front-loads the core action. It is concise, but the brevity borders on under-specification given the tool's complexity, so it loses a point for being too terse.

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?

Although an output schema exists, the tool is complex with nested objects and an enum. The description does not explain the meaning of direction, how events should be listed, or the time_range structure, making it insufficient for an agent to invoke the tool correctly in non-trivial cases.

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?

With 0% schema description coverage, the description must compensate for the four required parameters. It only vaguely references 'selected starting event' (start_event), while events, direction (with enum initial_event/termination_event), and time_range remain unexplained. This leaves the agent without enough information to correctly construct the input.

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 uses the specific verb 'Query' and the resource 'paths around a selected starting event', indicating a read-only path analysis tool. It adds the notion of a starting event, which gives some context beyond the tool name. However, it does not explicitly distinguish it from sibling query_* tools or clarify what 'paths' means, so it lacks sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives like query_event_analysis or query_funnel_analysis. There is no mention of context, prerequisites, or exclusions, leaving the agent without direction on tool selection.

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

query_retention_analysisB
Read-only

Query retention from an initial event to a returning event.

ParametersJSON Schema
NameRequiredDescriptionDefault
time_rangeYes
initial_eventYes
returning_eventYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the read-only safety is covered. The description adds the temporal relationship between initial and returning events, which is useful behavioral context. However, it doesn't disclose output format, time range semantics, or any other behaviors, so it doesn't go beyond the annotations meaningfully.

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?

A single, front-loaded sentence with no redundant words. It communicates the core action and key entities efficiently. The brevity is not padding but under-specification, yet for this dimension it deserves full marks for conciseness.

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 complexity (nested objects, output schema, sibling analytical tools), the description is minimal. It lacks context on what retention metrics are returned, how cohorts are defined, or how time_range options behave. The presence of an output schema reduces the need to explain return values, but the core semantic of retention analysis is not fleshed out, making the tool hard to use correctly for an agent.

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 0%, so the description must compensate. It clarifies the role of initial_event and returning_event (as start and end events) but provides no explanation of time_range (start_time/end_time vs recent_day). The nested object structure is also unexplained, leaving a significant portion of the parameters semantically ambiguous.

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 uses a specific verb ('Query') and resource ('retention') with the initial/returning event relationship. It clearly states what the tool does and distinguishes from siblings by focusing on retention, though it doesn't explicitly contrast with funnel or path analysis.

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?

The description provides no guidance on when to use this tool over siblings like query_funnel_analysis or query_event_analysis, nor any exclusions. It only implies usage through the term 'retention', which is insufficient for an agent to select among the many analytical siblings.

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

query_user_property_analysisC
Read-only

Query an aggregation over a user or event property.

ParametersJSON Schema
NameRequiredDescriptionDefault
propertyYes
time_rangeYes
aggregationYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
sourceYes
return_codeYes
return_messageYes

TDQS

C2.6/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is known. However, the description adds no behavioral context such as return format, pagination, limits, or required permissions, offering no value beyond the annotations.

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

Conciseness3/5

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

The description is a single, front-loaded sentence with no redundant words, making it concise. However, it is under-specified, which limits its usefulness despite being brief. It is not as extreme as a tautology but still lacks substance.

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 tool's nested schema, many sibling tools, and presence of an output schema, the description is far too minimal. It does not provide adequate context for tool selection or understanding of the aggregation types, leaving the agent to infer too much from the schema alone.

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?

The schema has 0% description coverage, and the description only mentions 'aggregation' and 'user or event property,' which vaguely map to the aggregation and property parameters. It does not explain time_range formats or the meaning of aggregation enum values like USER_NUM, leaving most parameters semantically unclear.

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 core function with a specific verb ('Query') and resource ('an aggregation over a user or event property'). It distinguishes the tool from non-aggregation siblings like funnel or retention analysis, but it could be confused with query_event_analysis or query_distribution_analysis since it doesn't explicitly differentiate.

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?

The description provides no guidance on when to use this tool versus the many sibling analysis tools. There are no alternative names, exclusions, or contextual hints, leaving tool selection ambiguous for an AI agent.

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. 10 tool updatesv0.1.0
    • First observedexecute_sql_query
    • First observedlist_event_metadata
    • First observedlist_property_metadata
    • First observedquery_distribution_analysis
    • First observedquery_event_analysis
    • First observedquery_funnel_analysis
    • First observedquery_interval_analysis
    • First observedquery_path_analysis
    • First observedquery_retention_analysis
    • First observedquery_user_property_analysis

TDQS

A3.5/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct analytics operation: event analysis, retention, funnel, distribution, path, interval, user property, plus direct SQL and metadata listing. No two tools overlap in purpose; the boundaries are clear.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern: query_* for analyses, execute_sql_query for SQL, list_* for metadata. Naming is uniform and predictable across the set.

Tool Count5/5

With 10 tools, the server covers a comprehensive read-only analytics surface without bloat. Each tool addresses a core analytics need, making the count well-scoped.

Completeness5/5

The tool set covers direct SQL, common analytics patterns (event, funnel, retention, path, distribution, interval, user property), and metadata discovery. This is a complete read-only analytics toolkit with no obvious gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server for exploratory data analysis across PostgreSQL, MySQL, and ClickHouse databases, providing safe, read-only access with comprehensive analysis capabilities.
    10
    6
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A read-only MCP server for querying telemetry data from configurable backends. Provides tools to list sources, describe schemas, run bounded queries, and compute aggregates.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI to interact with ThinkingData analytics through a read-only MCP service, supporting event/property queries, event analysis, retention analysis, and safe SQL execution.
    Apache 2.0