Skip to main content
Glama
u9401066

asset-aware-mcp

by u9401066

table_cite

Attach source references to table cells, query citation summaries, read full citation details, remove citations, and review cell change history while preserving table structure.

Instructions

📎 表格引用管理:為儲存格附加、查詢、移除來源引用。

引用是「平行附加層」,不改變表格資料結構。 每個引用用 AssetRef 指向具體來源(PDF section、URL、使用者輸入等)。

Operations:

  • add: 新增引用到儲存格

  • get: 查詢引用摘要(cell / row / table);完整引用用 read

  • read: 完整 cell/value/citation JSON 分頁,不截斷 canonical quote/locator

  • remove: 移除引用

  • cell_history: 查看儲存格變更歷史

Args: operation: 操作類型 table_id: 表格 ID row_index: 列索引 (0-based),get 時可省略取得全表引用 column_name: 欄位名,get 時可省略取得整列引用 refs: [add] 引用列表,每項為 AssetRef dict [{"source_type":"section","doc_id":"doc_xxx","asset_id":"sec_01","excerpt":"..."}] [{"source_type":"external","url":"https://doi.org/...","label":"Smith 2024"}] [{"source_type":"user_input","excerpt":"Patient reported"}] confidence: [add] Agent 信心度 0.0~1.0 notes: [add] 備註 ref_index: [remove] 移除特定引用索引(不指定則移除整個 cell 引用) text_offset: [read] 字元起點;後續頁必須保留 citation_sha256 text_limit: [read] 每頁 1..4000 字元,可能因回應上限縮短 citation_sha256: [read] 首頁回傳的 hash,拒絕混接不同 cell/value/citation

read requires a row_id (preferred) or row_index and column_name. Concatenate text_excerpt pages at one hash, verify UTF-8 SHA-256, then parse the full JSON. Follow next_text_offset until null. Readback does not verify source or meaning.

Examples: table_cite("add", "tbl_xxx", row_index=0, column_name="Drug", refs=[{"source_type":"section","doc_id":"doc_a","asset_id":"sec_01", "excerpt":"dose was 5mg"}], confidence=0.9) table_cite("get", "tbl_xxx") # 全表引用 table_cite("get", "tbl_xxx", row_index=0) # 全列引用 table_cite("cell_history", "tbl_xxx", row_index=0, column_name="Drug")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refsNo
limitNo
notesNo
offsetNo
row_idNo
table_idYes
operationYes
ref_indexNo
row_indexNo
confidenceNo
text_limitNo
column_nameNo
text_offsetNo
citation_sha256No

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.4.0
    • addedInput schema / properties / citation_sha256
      Added value: +{
      +  "default": "",
      +  "title": "Citation Sha256",
      +  "type": "string"
      +}
    • changedInput schema / properties / operation / enum
      Previous value: -[
      -  "add",
      -  "get",
      -  "remove",
      -  "cell_history",
      -  "coverage"
      -]New value: +[
      +  "add",
      +  "get",
      +  "read",
      +  "remove",
      +  "cell_history",
      +  "coverage"
      +]
    • addedInput schema / properties / text_limit
      Added value: +{
      +  "default": 4000,
      +  "title": "Text Limit",
      +  "type": "integer"
      +}
    • addedInput schema / properties / text_offset
      Added value: +{
      +  "default": 0,
      +  "title": "Text Offset",
      +  "type": "integer"
      +}
  2. First observedv0.7.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does it well: it discloses that citations do not modify the table structure, that read pagination must preserve citation_sha256 and follow next_text_offset, that text may be truncated by response limits, and explicitly warns that readback does not verify source or meaning.

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 well structured, front-loaded with the core concept, and organized into operations, arguments, and examples. Every section earns its place and there is no filler or redundant restatement of the tool name.

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?

The description is thorough for a complex polyglot tool with six operations and 14 parameters, but it omits the 'coverage' operation entirely and does not map limit/offset to any operation. Since an output schema exists, return-value shape does not need to be explained, but these gaps prevent the description from being fully complete.

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 description coverage is 0%, so the description must compensate. It documents most parameters, including operation, table_id, row_index, column_name, refs with concrete AssetRef examples, confidence range, notes, ref_index, text_offset, text_limit, and citation_sha256. However, it leaves limit, offset, and the 'coverage' operation unexplained.

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/resource pair: managing source citations attached to table cells. It clearly distinguishes the tool from data-table operations by explaining that citations are a parallel attachment layer that does not change the table data structure, and it enumerates the operation modes explicitly.

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 gives actionable intra-tool routing: 'get' returns summaries while 'read' returns full citations, row_index/column_name can be omitted for table/row-level queries, and read requires row_id or row_index+column_name. It does not explicitly name sibling tools or state when table_cite should not be used, so it misses the strongest possible usage guidance.

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