# 【Agent Harness】06｜工具表面工程、渐进披露与协议演进：MCP、CodeAct 与受限解码

DevFeed: [【Agent Harness】06｜工具表面工程、渐进披露与协议演进：MCP、CodeAct 与受限解码](<https://devfeed.tech/articles/agent-harness-06-mcp-codeact-150288.md>)

Original publisher: [Read original article](<https://quant67.com/post/agent-harness/06-tool-surface-and-protocol-boundaries/06-tool-surface-and-protocol-boundaries.html>)

Author: Liao Tonglang

Published: 2026-11-23T00:00:00Z

Content type: article

Language: zh

Sources: [土法炼钢 - 系统与基础设施](<https://devfeed.tech/sources/source-4.md>)

Topics: [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [Multi Agent Systems](<https://devfeed.tech/topics/multi-agent-systems.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [aci](<https://devfeed.tech/tags/aci.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agent-harness](<https://devfeed.tech/tags/agent-harness.md>), [ai-infra](<https://devfeed.tech/tags/ai-infra.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [code](<https://devfeed.tech/tags/code.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [codeact](<https://devfeed.tech/tags/codeact.md>), [constrained-decoding](<https://devfeed.tech/tags/constrained-decoding.md>), [context](<https://devfeed.tech/tags/context.md>), [context-engineering](<https://devfeed.tech/tags/context-engineering.md>), [context-engineering-for-ai-agents](<https://devfeed.tech/tags/context-engineering-for-ai-agents.md>), [disclosure](<https://devfeed.tech/tags/disclosure.md>), [discovery](<https://devfeed.tech/tags/discovery.md>), [harness](<https://devfeed.tech/tags/harness.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [tag-dd46ac3395e9](<https://devfeed.tech/tags/tag-dd46ac3395e9.md>), [tool-calling](<https://devfeed.tech/tags/tool-calling.md>), [xgrammar](<https://devfeed.tech/tags/xgrammar.md>)

## AI overview

The source argues that agent tool design must balance schema and payload costs with tool-selection safety and cache stability. For larger tool catalogs, it recommends keeping the `tools[]` prefix stable: use state-aware logit masking for smaller sets, append discovered schemas to `messages[]` as catalogs grow, and consider sandboxed CodeAct when tasks require repeated calls and large intermediate results. Its simulation reports that at 200 tools, CodeAct batching cut billed input about 10.9x versus full injection under the stated assumptions, while reducing the task to three model rounds; these are simulated results, not external measurements. It also recommends task-oriented tools, bounded outputs, and actionable structured errors. Constrained decoding enforces syntax but cannot guarantee valid entities, business rules, or safe actions, so semantic validation and policy gates remain necessary. The text describes MCP `2026-07-28` as moving to a stateless core with discovery, request-state continuation, and task extensions, easing multi-replica routing while requiring protected continuation tokens and explicit persistence of cross-call state.

## Source excerpt

拆解 10 到 200 工具规模下的 ACI 工具表面设计、前缀稳定 Logit 掩码、渐进发现与 CodeAct 编排，剖析受限解码边界及 MCP 2026-07-28 无状态演进对多副本 Harness 的架构影响。