“api-design”
Exposing Your Payment Gateway as an MCP Tool Server
MCP lets agents call tools — and payments are the scariest tools you can expose. Here is how to structure an MCP tool server over your payment gateway with two-phase approval, idempotency, and least privilege.
Versioning Tools: Backward-Compatible Function Evolution for Agents
Treat LLM function-calling tool schemas as a public API you cannot break — additive-only evolution rules, deprecation with dual registration, model behavior on schema changes, and golden tool-call fixtures that catch regressions before deploy.
Streaming vs. Polling: Response Patterns for Async Agent Clients
When to stream agent responses, when polling is the right answer, and how to combine them with server-sent events, WebSockets, and durable run state.
Idempotent Tool Design: Making Every Agent Call Safe to Repeat
Agents retry constantly, and naive tools double-charge or duplicate rows when they do. Apply Stripe-style idempotency keys, natural keys, and dedupe patterns so every tool call is safe to repeat.
Versioning MCP Servers: Backward-Compatible Tool Interfaces
Maintain backward compatibility and manage API evolution when updating Model Context Protocol (MCP) tool schemas across multi-agent fleets.
Designing Tool Schemas That Models Won't Misuse
Design tool schemas that prevent LLM misuse. Use clear descriptions, strict type validation, and defensive patterns to keep agents on track.