Skip to main content
Glama
EvanSener

snw-derived-mcp

by EvanSener

snw-derived-mcp

Agent Native 的派生属性 MCP 服务。外部 Agent 提交“目标对象 + 字段需求”,服务在 Amazon Ads mock 本体的三跳邻域内确定来源字段、校验 Link 基数、生成 Semantic Join SQL,并可创建和执行只读派生属性。

核心规则

  • 全链路 to-one 直接投影;任一跳 to-many 必须聚合。

  • 支持 1:1、1:N 和带 junction table 的 M:N Link;M:N 双向均视为 many

  • 支持 Count、Sum、Avg、Min、Max、去重计数、Collect List/Set。

  • 路径最多三跳,超出返回 OUT_OF_NEIGHBORHOOD

  • 普通 Derived 拒绝过滤、排序和“取最新一条”。

  • SQL 流程为 seed → semi-select → 根键传播 → 聚合 → LEFT JOIN 回根对象

  • DuckDB 可执行;Spark/Hive 可生成 LEFT SEMI JOIN 预览。

Related MCP server: Glossary MCP Server

运行

uv sync
uv run snw-derived-mcp --database var/snw-derived.duckdb

MCP 客户端配置示例:

{
  "mcpServers": {
    "snw-derived": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/snw-derived-mcp", "run", "snw-derived-mcp"]
    }
  }
}

外部 Agent 调用顺序

  1. snw_list_object_types

  2. snw_get_object_neighborhood

  3. snw_analyze_field_request

  4. 仅当结果为 READY 时,将返回的 planontology_versionplan_digest 原样传给 snw_create_derived_property;同名更新必须显式设置 replace_existing=true

  5. snw_execute_derived_property 验证 mock 数据结果

示例:object_type="广告组"request="广告活动状态" 会定位到 AdGroup → Campaign.status,判断为全程 to-one,无聚合,建议字段名 campaign_status

M:N 示例:object_type="广告活动"request="标签名称列表" 会沿 Campaign ↔ Label 的 junction table 生成 Collect List 计划。

验证

uv run ruff check .
uv run mypy src
uv run pytest -q
uv build

本项目不连接 Palantir、真实 Amazon Ads 或生产数仓;实现的是本仓库规格锁定的 Derived 语义演示。

Available Tools

6 tools
snw_analyze_field_requestC

在三跳邻域内解析字段来源、校验基数,并生成不可变语义计划和 SQL。

ParametersJSON Schema
NameRequiredDescriptionDefault
dialectNoduckdb
requestYes
aggregationNo
object_typeYes
source_objectNo
source_propertyNo
collection_limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.6/5.0
Behavior2/5

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

With zero annotations, the description must state whether the tool mutates state, the read-only nature, or side effects. It says it generates a plan and SQL but does not explicitly state that it only analyzes or does not execute changes, that it requires particular permissions, or what '不可变' implies for the caller. The phrase 'analyze' implies a read-like operation, but the important safety properties are left implicit.

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 front-loaded sentence with no filler. It names the operated resource, the work done, and the output artifacts economically. However, it is concise to the point of omission; stillh, for its small size, it is 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?

The tool has seven parameters and a complex analysis task, yet the description gives almost no decision-relevant context for constructing the request. The presence of an output schema covers return-value shape, but an agent still lacks clues about why to use this specific tool, what required fields mean, and how parameters interact in the three-hop neighborhood and cardinality logic.

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%, so the description must compensate, but it adds little. It maps the general tool behavior without explaining the meaning of the seven parameters: it does not indicate what request contains, how source_object and source_property scope the search, what aggregation is used for, what dialect values are recognized, or what collection_limit/howLimit controls.

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 a specific operation ('解析字段来源', '校验基数', '生成不可变语义计划和 SQL') and a bounded scope ('三跳邻域内'). It is clear about the resource and deliverables, and the ```execute```/```create``` siblings are different enough that a reader can likely tell this is the analysis step, but it does not name any sibling explicitly.

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 explicit guidance about when to call this tool instead of the siblings, when it is not appropriate, or what steps should precede it. The only signal is the name 'analyze', which suggests it precedes execution or creation, but the description does not say 'use before executing' or exclude cases like direct execution.

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

snw_create_derived_propertyB

持久化只读派生属性;同名替换必须显式设置 replace_existing。

ParametersJSON Schema
NameRequiredDescriptionDefault
planYes
plan_digestYes
ontology_versionYes
replace_existingNo
property_api_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It mentions that the property is read-only and that persistence occurs, but it does not disclose potential side effects (e.g., dependencies, resource usage) or the fact that replacing requires explicit flag. It also does not explain what happens on failure. This is adequate but not comprehensive.

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 exceptionally short, which is good for conciseness, but it may be too sparse given the tool's complexity. The single sentence is front-loaded with the core action, and the replacement note is placed at the end. However, for a tool with nested objects and multiple params, more detail could be helpful without being verbose.

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?

Despite having an output schema, the description is extremely incomplete for a complex creation tool. It lacks any guidance on the required parameters (like plan, plan_digest, ontology_version), what constitutes a valid plan, or how to construct it. The 0% schema coverage means agents are left without understanding the core inputs, making this definition inadequate.

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% and the schema is complex (requires understanding of SemanticJoinPlan, LinkHop, etc.). The description does not explain the parameters beyond hinting at replace_existing, leaving most parameter semantics (e.g., what plan_digest is, how plan is structured) unclear. The description fails to compensate for the lack of schema documentation.

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 persists a read-only derived property, which is a specific verb-resource combination. It also highlights the key requirement for replacement. However, it does not explicitly contrast with siblings like snw_execute_derived_property, though the sibling list suggests it is for creation.

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?

The description implies the tool is for persisting derived properties, and the note about replacement with replace_existing provides usage context. It does not explicitly state when not to use it or mention alternatives, but the sibling names suggest creation vs execution distinction. This is clear enough for an agent to infer usage.

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

snw_execute_derived_propertyC

在本地 Amazon Ads mock 数据上执行已注册派生属性。

ParametersJSON Schema
NameRequiredDescriptionDefault
object_idsNo
target_objectYes
property_api_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.8/5.0
Behavior2/5

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

Annotations are absent, so the description carries full disclosure burden. It does reveal a prerequisite (the property must already be registered) and the local mock scope, but it does not say whether execution mutates state, computes and returns values, or fails when the property is absent.

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, front-loaded sentence with no filler or redundancy. It is concise, though its brevity leaves substantive gaps addressed in other dimensions.

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?

With no annotations and very little description, the tool is under-specified for the agent to invoke confidently. It lacks parameter meaning, usage direction, and behavioral expectations; the existence of an output schema covers return format but not call context.

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. target_object, property_api_name, and object_ids are named but not semantically defined, so the agent gets no added meaning beyond the raw field titles.

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 specifies a clear action ('execute'), a precise resource ('registered derived property'), and a scope ('local Amazon Ads mock data'). This contrasts with sibling tools named create_derived_property and list_derived_properties, making the tool's purpose distinguishable 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 Guidelines2/5

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

There is no explicit when-to-use guidance, no exclusions, and no mention of alternatives. 'Local mock data' implies a test/dev context, but the agent is not told when to select this tool over create/list/analyze siblings.

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

snw_get_object_neighborhoodA

返回对象在最多三跳内的全部无环 Link 路径及每跳基数。

ParametersJSON Schema
NameRequiredDescriptionDefault
max_hopsNo
object_typeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It indicates a read-only 'returns' behavior and discloses the acyclic/path and hop-limit semantics. However, it does not explicitly state that it has no side effects, warn about potentially large result sets, or mention any operational considerations.

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, tightly packed Chinese sentence that front-loads the core behavior and key constraints. There is no filler or repetition.

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?

Given the tool reads a graph neighborhood and has an output schema, the return values are presumably covered by the schema. The description covers the essential graph concept and hop limit, but omits any guidance on acquiring or naming the object type, and does not clarify whether all link types are included. Sibling distinctions are also left entirely to the name.

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 0%, yet the description adds meaning for max_hops by clarifying the 'at most three hops' limit. It does not enrich object_type explanation; the agent must infer that 'object' refers to object_type and would not know how to choose valid values without additional context.

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 states a specific verb ('返回' / returns), a specific resource (acyclic Link paths around an object), and a scope (within at most three hops, including per-hop cardinality). It is clearly distinguishable from the sibling tools, which concern object types, derived properties, and field requests.

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 given on when to use this tool versus alternatives. It does not mention prerequisites such as how to obtain a valid object_type, nor does it explain why an agent would choose this over sibling tools like snw_list_object_types or snw_execute_derived_property.

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

snw_list_derived_propertiesA

列出已创建派生属性及完整可审计语义计划。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the behavioral burden. The verb 'list' implies a read-only operation and the phrase 'complete auditable semantic plan' hints at output scope, but the description does not disclose details such as pagination, depth, or whether execution is triggered. Still, the read-only nature is reasonably inferable.

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 that front-loads the action and resource, then adds one meaningful qualifier about the semantic plan. There is no redundancy or filler.

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?

Given that the tool has no parameters and an output schema exists, the description sufficiently conveys what the tool returns and its general purpose. It does not need to explain return values in detail. However, it does not mention how this listing relates to sibling list tools, which is a minor gap.

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 has zero parameters enforce, so the description does not need to document parameter details. The baseline for zero-parameter tools is 4, and the description does not introduce any confusion.

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 states a specific verb ('列出'/'list') and a clear resource ('created derived properties'), and adds that it returns the complete auditable semantic plan. This distinguishes it from siblings like snw_create_derived_property and snw_execute_derived_property, which are clearly different operations.

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 gives no guidance on when to choose this tool over alternatives such as snw_execute_derived_property or snw_analyze_field_request. It implies a listing use case but does not state exclusions or conditions for preferring a sibling.

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

snw_list_object_typesA

列出可作为派生字段根对象的对象类型。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. The description is a plain factual statement about listing and adds no behavioral context beyond the function itself, such as ordering, pagination, or any safety caveats. However, as a read-only list operation with a defined output schema, the behavioral surface is modest, so a mid-range score is appropriate.

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 concise sentence with no wasted words, appropriately sized for a zero-parameter list tool. The core purpose ('list object types usable as derived-field roots') is front-loaded. It is slightly under-specified in surrounding context, but brevity is fitting here.

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?

Given the tool's zero parameters and the presence of an output schema, the description does not need to explain return values. It adequately states what is listed and its relationship to derived fields. For such a simple list operation, this level of coverage is complete enough for an agent to call it correctly.

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 has zero parameters, so the baseline is 4 per the rubric. There are no parameter semantics for the description to clarify, and the schema coverage is effectively complete at 100% (empty schema). The description adds no param details, but none are needed.

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 a specific action (list) and a distinct resource (object types that can serve as root objects for derived fields). This distinguishes it from the sibling snw_list_derived_properties, which lists properties rather than object types. It is clear and not a tautology, though it does not explicitly name the sibling it is not.

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 context by explaining the purpose (object types usable as derived-field roots), which signals when this tool is relevant during derived-property creation. However, it provides no explicit when-to-use/when-not guidance and names no alternative tools, leaving selection largely to inference.

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. 6 tool updatesv0.1.0
    • First observedsnw_analyze_field_request
    • First observedsnw_create_derived_property
    • First observedsnw_execute_derived_property
    • First observedsnw_get_object_neighborhood
    • First observedsnw_list_derived_properties
    • First observedsnw_list_object_types

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct resource or action: object type enumeration, graph neighborhood exploration, execution, analysis/planning, creation, and listing. There is no meaningful overlap that would cause an agent to confuse one tool with another.

Naming Consistency5/5

All tools share a consistent snw_ prefix and follow a clear verb_noun pattern. The minor singular/plural variation (derived_property vs derived_properties) is standard and does not create confusion.

Tool Count5/5

Six tools is well-scoped for the derived-property workflow. Each tool covers a distinct step in the lifecycle without unnecessary redundancy or bloat.

Completeness4/5

The server covers exploration, analysis, execution, creation/replacement, and listing of derived properties. The only notable gap is the lack of an explicit delete/drop operation, though replace_existing covers updates and the core workflow is otherwise complete.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a read-only PostgreSQL SQL surface for LLM agents via MCP, with defense-in-depth security layers for safe database queries.
    3
    MIT
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables semantic search and exploration of a business glossary knowledge graph, allowing users to query terms, expand related concepts, trace dependencies, and resolve physical table mappings.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables natural language querying of SQL databases and REST APIs through the MCP protocol, grounded in a semantic layer.
    2,887
    1
    AGPL 3.0
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables agents to perform controlled enterprise data queries through semantic intent, with runtime validation of statistics, filters, granularity, permissions, and physical bindings. Exposes tools like semantic_query for safe, fail-closed access to data horizons and capabilities.
    -