惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
博客园_首页
T
Tailwind CSS Blog
美团技术团队
博客园 - 叶小钗
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Microsoft Azure Blog
Microsoft Azure Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
MongoDB | Blog
MongoDB | Blog
The Cloudflare Blog
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Discrete MCP tools vs execute_code: when each wins
Bryan Clark · 2026-06-24 · via DEV Community

Bryan Clark

When we wanted our boat agents to read SignalK — wind, position, battery,
depth — over MCP, there was already a capable server for it:
VesselSense/signalk-mcp-server
(TypeScript, MIT). It's well built. Our prime directive says use existing
tools before building your own, and we take that seriously — our ship's log
is someone else's plugin
for exactly that reason.

We built a separate server anyway:
signalk-mcp. This post is
the honest version of why — because the two servers represent two genuinely
different answers to the same design question, and which one you want depends
entirely on what's driving it.

The design question

How much of the query should the model write?

VesselSense answers: all of it. It exposes a single execute_code tool.
The agent writes JavaScript, which runs in a sandboxed V8 isolate with access
to the SignalK data model. One tool definition in the context window, unlimited
query flexibility. Want the average of three battery banks, but only if the
engine is off? Write the code. No server release needed.

signalk-mcp answers: none of it. It exposes discrete, named tools —
read_sensor(path), battery_state(bank), depth_state(),
get_active_alarms() — each with a one-argument schema and a fixed response
shape. The flexibility ceiling is whatever tools the server ships.

Why execute_code wins with frontier models

If your agent is a frontier model, execute_code is hard to beat:

  • Token efficiency. One tool definition instead of a dozen. For long agent sessions, tool schemas are recurring context-window rent.
  • No n+1 round trips. A composite question ("compare house and starter bank voltage trends") is one code block, not four tool calls.
  • No server roadmap coupling. The model can answer questions the server authors never anticipated.

A big model writes small JavaScript correctly nearly every time. The
flexibility is real and the costs are low.

Why discrete tools win on a boat

Our target runtime is the opposite end of the spectrum: a voice assistant on
the boat, designed to run against small local models, with a text-to-speech
front-end and a sailor's attention split between the agent and the water.
Two things dominate that design, and neither is token efficiency:

1. Reliability. "What's my battery?" must work every time, in swell,
on the local model. A named tool with one validated argument is a much
smaller ask than writing correct JavaScript against a data model the agent
half-remembers. And the failure modes differ in kind: a wrong tool argument
fails loudly at the schema validator; subtly wrong JavaScript fails
quietly with a plausible-looking number. On a boat, the quiet failure is
the dangerous one.

2. A speech contract. Every signalk-mcp value carries a display string
the agent speaks verbatim — "16.5 knots", "48.8 North, 123.1 West",
spelled-out units, no symbols a TTS engine mispronounces, no radians, no
Kelvin. The server formats; the model relays. We've
written before about
why this belongs in the tool layer and not the prompt: prompt-level formatting
rules are model-dependent and leak. With execute_code, the model touches raw
SignalK values (SI units, decimal degrees, ISO timestamps) on every query, so
every query is a fresh chance to mispronounce the data. With discrete tools,
the raw values never reach the model at all.

That second point keeps proving itself. The same week we wrote this, we
watched a capable cloud model restyle a coordinate string three different
ways through three increasingly strict prompt instructions — and stop only
when the tool returned one pre-assembled sentence to relay. Models reformat
whatever they're allowed to reassemble. Tools that want deterministic output
must hand over finished strings.

So which one do you want?

execute_code (VesselSense) discrete tools (signalk-mcp)
Best driver frontier model small/local or voice-first model
Query flexibility unlimited fixed tool surface
Context cost one tool schema one schema per tool
Composite queries one call several calls
Failure mode quiet (wrong code, plausible output) loud (schema rejection)
TTS output model formats raw values server-formatted display strings
New question support immediate needs a server release

Neither column is "better." If you're driving SignalK with a frontier model
and want maximum flexibility, use VesselSense — genuinely. If you want
simple, reliable, speakable tools for a voice-first agent, that's what
signalk-mcp is for.

The deeper takeaway isn't about boats: tool design is model-targeting.
The same backend deserves a different MCP surface depending on who's calling.
Token-efficient power tools for big models; validated, pre-formatted,
single-purpose tools for small ones. Pick the surface for the agent you
actually run.