Skip to main content
Glama

Build chart definition

compile_chart_body
Read-only

Compile Chart

When to use: 차트 하나를 대시보드에 저장하기 전에, 저장 가능한 정의(body)를 만들 때. 차트 종류와 조회 조건을 넘기면 화면이 그대로 렌더링할 수 있는 정의와 주의사항을 돌려준다. 응답은 {body, version, warnings} 래퍼이므로, 커스텀 대시보드 문서 생성 tool 에는 그중 body 필드만 넘긴다.

Limitations: 데이터를 읽지 않는다 — 실제 값·행 수가 필요하면 차트 평가 tool 을 쓴다. chart_config(차트 종류·표시 설정)와 query_params(조회 조건) 두 입력이 모두 필요하다. 거부 응답은 원인마다 다르다 — 두 입력 자체가 빠지면 422, 값이 스펙에 맞지 않으면 400, 지원하지 않는 chart_type 도 400, 존재하지 않는 스펙 버전은 404 다. 컴파일이 성공해도 조회 조건 자체가 데이터를 반환하는지는 보장하지 않는다. 표 차트의 컬럼 표기(통화 기호·소수 자릿수·천단위 구분)는 만들어 주지 않는다. 새 차트를 방금 만든 상태를 그대로 돌려주므로, 표기가 필요하면 호출자가 tableConfig 에 직접 넣어야 하고 넣지 않으면 조용히 빠진다. 컬럼 이름처럼 보이지만 조회 결과의 컬럼 키와 맞물린 식별자가 있다. 다중 소스 measure 의 A__/B__ 접두사와 시계열 컬럼 time_id 가 그것이다. 읽기 좋게 고치면 값이 끊기고, 편집 화면은 이 둘을 자동으로 복원해 그리므로 리포트 화면에서만 드러난다. segmentKeys 를 비우면 all 하나로 채워진다. 세그먼트로 그리는 차트(막대·원·지도 등)와 분석 기준으로 나눈 세로 막대 차트, chart_view='compare' 로 나눈 꺾은선 차트는 이때 리포트 화면이 비고 warnings 에 경고가 실린다. 필요 여부는 차트 종류마다 다르므로(PARETO 는 all 이 정답이다) spec 도구 응답의 agent_guide.segmentKeys 를 확인하고, 값을 넣을 때는 차트 평가 tool 로 실제 분석 기준 값을 먼저 확인한다.

Examples:

  • Q: 채널별 매출 막대 차트로 저장할 정의를 만들어줘 params: {'body': {'chart_config': {'chart_type': 'COLUMN', 'chart_view': 'compare', 'segmentKeys': ['자사몰', '네이버 스마트스토어', '쿠팡']}, 'query_params': {'data_source': 'commerce_order', 'measures': ['net_sales'], 'dimensions': ['channel_name'], 'date_filters': {'type': 'last', 'delta': 30, 'delta_freq': 'day'}, 'freq': 'day'}}}

Output shape: object: {body, version, warnings[]}

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": {
      "chart_config": "<chart_config>",
      "query_params": "<query_params>"
    },
    "name": "compile_chart_body"
  }
}

Input Schema

NameRequiredDescriptionDefault
versionNoSpec version to use for compilation (default: current)current
chart_configYes
query_paramsYes
apply_sensorsNoApply chart-type-aware auto-adjustments (freq, PoP, date range)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Although the annotations already declare a read-only, non-destructive, closed-world profile, the description adds unusually rich behavior: it reads no data; error codes vary by cause (422/400/404); success does not guarantee the query returns rows; table column formatting is not generated and is silently dropped unless the caller supplies tableConfig; identifier prefixes (A__/B__) and time_id must not be prettified; and an empty segmentKeys value is filled with 'all', which blanks certain chart types and adds warnings.

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 well structured with explicit When-to-use, Limitations, Examples, and Output-shape sections, and it front-loads the purpose. It is long and dense; the notes on A__/B__ prefixes and time_id are niche but earn their place by preventing silent data corruption, while a few clauses (for example, about the chart being 'as if just created') could be tightened.

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 read-only compile tool with nested-object inputs and no output schema, this definition is nearly complete: it describes the return wrapper ({body, version, warnings}), enumerates failure modes, gives a worked example, and explains silent-failure hotspots. The only meaningful gap is apply_sensors, whose automatic adjustments (freq, PoP, date range) are never mentioned in the description.

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 only 50%, and both nested objects (chart_config, query_params) are undocumented in the schema, so the description has to compensate. It does: it explains chart_config as chart type and display settings, query_params as query conditions, and describes segmentKeys, tableConfig, and measure prefixes inside them. It does not cover apply_sensors (chart-type-aware auto-adjustments) or version.

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 and resource: it compiles a savable chart definition (body) from a chart type and query conditions, so that a screen can render it directly. It also distinguishes this tool from the chart evaluation tool, which reads data, and from the spec tool: the definition points to spec responses for segmentKeys guidance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

It states when to use the tool (when building a definition before saving a chart to a dashboard), when not to use it (when actual values or row counts are needed, use the chart evaluation tool), and where the output goes (pass only the body field to the custom-dashboard document tool). It also names a prerequisite step: confirm segment values with the chart evaluation tool first.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources