今日已更新 240 条资讯 | 累计 23823 条内容
关于我们

标签:#charts

找到 4 篇相关文章

AI 资讯

How Bonnard Builds Agent-Friendly MCPs

Exposing your data over MCP is the easy part. Designing a tool an agent uses well is the hard part. An agent can only use a tool it can read, so the work is shaping the tool for how the model calls it, not just for the human looking at the result. These are the techniques behind @bonnard/mcp-charts and the visualize tool. Discovery-first, so the agent stops guessing An agent that guesses your schema writes wrong queries. So the first tool the agent meets is a discovery tool. It calls visualize_read_me to load the chart options, the tool schema, and worked examples before it ever calls visualize , and an explore_schema tool to learn your tables and columns before it writes SQL. The agent reads, then acts. A small set of purpose-built tools The temptation is one tool per metric, or a single tool that takes arbitrary SQL and hopes. Both fail: too many tools blow the agent's attention budget; one firehose tool gives it no guardrails. Bonnard ships a small set, discover, query, visualize, each with a narrow, obvious job. The agent picks the right one because there are few of them and each does one thing. // a small, purpose-built set, not one tool per metric server . registerTool ( " explore_schema " , { /* list tables + columns */ }, listSchema ); addCharts ( server , { runSql }); // registers visualize_read_me + visualize Compact, honest responses A tool that returns 10,000 raw rows poisons the context window and the agent's next decision. Bonnard's responses are sized for a model to read: Row caps with a completeness flag. Results are capped and tagged partial or complete , so the agent knows whether it is looking at everything. Partial-result warnings. When results are capped, the response says so and tells the agent not to sum or average the visible rows, use a measure instead. Summaries over dumps. The chart comes back with a compact text summary the model can reason over, not just an image it cannot read. Errors that guide the next action A bare "error: invalid co

2026-07-16 原文 →
AI 资讯

fulgur-chart: deterministic SVG/PNG from Chart.js JSON, without JavaScript

A new member has joined the fulgur family. fulgur-chart — a CLI that takes Chart.js v4-compatible JSON specs and renders deterministic SVG/PNG charts. No browser required. https://github.com/fulgur-rs/fulgur-chart Two things make it different: it doesn't spin up a browser, and for a fixed version, font, and rendering options, the same JSON input always produces byte-identical output. This post covers why I built it, a timing coincidence that made me feel like I was on the right track, and how to use it. Why I wanted graphs in PDFs fulgur and fulgur-chart are built around one idea: AI agents should be able to generate documents that look good . There are three steps to that argument. First, Markdown isn't expressive enough. For client-facing reports, plain Markdown often undersells otherwise strong content. Second, visual quality is persuasive. A well-formatted report lands differently than a wall of text. Third — and this is the one I keep coming back to — in many business workflows, PDF carries more institutional weight than a Markdown file or a transient web page . That authority has two dimensions. There's a cognitive one: PDFs read as "serious documents." Proposals, reports, invoices — the format itself signals credibility. And there's a technical one: PDF can support digital signatures, encryption, and archival profiles such as PDF/A. That's the ground flpdf covers, a pure-Rust PDF toolkit modeled on qpdf's workflow. So the goal is always PDF, not HTML, not a web page. That's what fulgur is for. And a polished report needs charts. But Markdown can't draw charts. Which brings me to a problem I already knew was coming: the Chart.js library requires JavaScript to run . fulgur has no browser and no JS runtime, so there was no path to running Chart.js directly. The design choice: no JS engine The obvious alternative was to embed a JavaScript runtime. I could either run Chart.js with a compatible Canvas implementation, or build a JavaScript renderer that consumes Cha

2026-06-24 原文 →