Monday, September 7, 2026

Testing AI Agents That Use MCP: From Working Tools to Reliable Outcomes

Model Context Protocol servers can make AI agents more useful by connecting them to databases, applications, and business workflows. However, a server that responds correctly to a direct request is not automatically ready for real-world use. Once a language model must choose a tool, build the right arguments, interpret the response, and decide what to do next, reliability becomes a system-level challenge.

A good testing strategy separates layers. Unit tests verify the business logic behind each tool. Protocol tests check discovery, communication, message exchange, and error handling. Conformance tests confirm that schemas match what the tool actually accepts and returns. Security and load tests examine permissions, isolation, prompt injection, timeouts, and capacity. Agent evaluations then test the behavior that software checks cannot capture: whether the model finds the correct tool, uses it properly, and completes the user’s goal.

This matters because an MCP tool is not called by predictable application code. It is called by a probabilistic model that reads tool names, descriptions, schemas, instructions, and conversational context. Two tools may appear similar. A required field may be documented but easy to misunderstand. The agent may answer from memory instead of using a tool, make unnecessary calls, repeat the call, or stop before a multi-step task is finished.

Useful evaluations begin with a clear task and a measurable definition of success. Each attempt is one trial, and several trials are needed because model behavior can vary. Graders score different parts of performance, while traces record the prompts, available tools, arguments, responses, intermediate decisions, timing, and final answer. Importantly, the evaluation should check what actually changed in the environment. If an agent says that a refund was issued, the refund must exist in the system of record.

A strong scorecard covers several dimensions. Tool-selection accuracy measures whether the agent chose the required tool and avoided irrelevant ones. Argument checks catch missing, malformed, or incorrect values. Task-completion scoring verifies that all requested work was finished, including dependent calls in the right order. Final-state checks confirm the real-world result. Other measures can assess whether tool outputs are understandable, whether the agent used too many calls or tokens, and whether performance stays consistent across repeated runs.

Dataset quality matters more than size. Start with the tasks developers already test manually, then add common user requests, support incidents, bug reports, and failed production traces. Every confirmed failure can become a regression case. Synthetic tasks can increase coverage, but they should be reviewed by people who understand the domain and can agree on the expected behavior.

A balanced test suite should include more than successful examples. It should cover requests that require no tool, prompts that could match several similar tools, multi-step workflows, missing information, upstream failures, permission limits, and actions with side effects. High-risk operations such as sending messages, deleting records, charging customers, or changing access should verify clear user intent, exact arguments, and execution count. A reliable agent should neither bypass restrictions nor perform an approved action twice.

Different behaviors need different graders. Deterministic checks work best when there is one correct tool, format, value, call count, or stored result. Trajectory checks can confirm dependencies and step limits without forcing one rigid sequence. Model-based graders are useful for semantic qualities such as completeness, clarity, groundedness, or appropriate refusal, but their rubrics should be narrow and tested against human judgment. One average score can hide serious failures, so thresholds should be set separately for different risk levels.

Capability testing and regression testing should also remain separate. Capability suites should contain difficult tasks that reveal where the agent can improve. Regression suites should protect behaviors the agent already handles reliably. As performance improves, solved cases can move into the regression suite while harder cases take their place. This prevents scores from becoming meaningless and helps teams detect cases where progress on complex tasks causes failures on routine ones.

When an evaluation fails, the trace should guide the diagnosis. First, confirm that the grader is fair. Then inspect tool choice, schema clarity, argument construction, server output, agent instructions, and model capability. A skipped tool may point to a weak description. Bad arguments may reveal confusing field names. A correct call with the wrong result may indicate a server problem. Comparing the same case across models or tool definitions can help isolate the cause.

Finally, evaluations should become part of the development and release process. Version datasets, prompts, schemas, tool descriptions, models, and graders. Run fast regression tests on proposed changes, use broader suites before releases, and block updates that violate critical safety thresholds. After launch, combine automated evaluations with production monitoring, user feedback, transcript review, and controlled experiments. The goal is not a perfect score, but a living measurement system that makes failures visible, improvements comparable, and agent behavior increasingly dependable.

Sunday, September 6, 2026

The Best Leadership Lessons I’ve Learned as an Engineering Manager

Engineering management is often described as a technical leadership role. But most of the job is not about code. It is about people: understanding them, giving feedback, handling conflict, building trust, and helping a team do its best work.

Several books have shaped how I think about this: Surrounded by Idiots, Surrounded by Bad Bosses, Radical Candor, and How to Win Friends and Influence People. Here are the lessons I find most useful.

People need different things from you

Surrounded by Idiots describes four broad communication styles using colors. Some people are fast and direct. Some are social and full of ideas. Others are calm, patient, and supportive. Some prefer detail, structure, and clear facts.

The labels are not perfect, and people should not be placed into fixed boxes. Still, the main lesson is valuable: the way you prefer to communicate may not work for everyone.

As an engineering manager, I try to adjust my approach.

A developer who likes detail may need a written plan before starting. A fast-moving engineer may prefer a quick decision and the freedom to act. A quieter team member may need time to think before sharing an opinion.

Good communication is not only about being clear. It is about being clear in a way the other person can understand.

Do not become the bad boss you once had

Surrounded by Bad Bosses shows how leadership problems often come from a mismatch between the manager and the employee. A manager may think they are being helpful, while the employee feels controlled, ignored, or rushed.

This is an important reminder: your intention matters less than the effect your behavior has on the team.

For example, checking progress every few hours may feel like support to you. To the engineer, it may feel like a lack of trust. Giving someone complete freedom may feel empowering, but they may experience it as a lack of direction.

Ask simple questions:

“What support would help you most?”

“Do you want advice, feedback, or space to solve this?”

“Is my level of involvement working for you?”

Strong managers do not assume they know what people need. They ask.

Be kind enough to be honest

The core idea of Radical Candor is simple: care personally and challenge directly.

Feedback should not be cruel, but it should also not be hidden behind vague language. Saying “Everything looks fine” when someone is struggling does not protect them. It prevents them from improving.

Useful feedback is clear, specific, and focused on behavior.

Instead of saying, “You need to communicate better,” try:

“When the release date changed, the rest of the team did not hear about it until the next day. Next time, please post an update as soon as the plan changes.”

It also helps to ask for feedback before giving it. A manager who welcomes criticism makes honesty safer for everyone.

Make people feel seen

How to Win Friends and Influence People teaches a timeless lesson: people respond better when they feel respected and understood.

Learn what matters to each person. Listen without preparing your reply. Give honest appreciation. Admit when you are wrong. Avoid embarrassing people in front of others.

In engineering teams, recognition does not always need to be dramatic. Thank someone for improving a test suite, helping a teammate, writing clear documentation, or raising a risk early.

People are more likely to accept your feedback when they know you also notice their good work.

The main lesson

The best engineering managers are not the ones with all the answers. They are the ones who stay curious about people.

Adapt your communication. Check the effect of your leadership. Give honest feedback with care. Listen closely. Show appreciation. Admit mistakes.

Technical knowledge may help you earn trust at the start. How you treat people determines whether you keep it.

What We Learned About Building MCP Servers That Hold Up in the Real World

 

We recently spent time with two excellent posts on MCP server design: GitHub’s guide to secure, scalable remote MCP servers and Block’s playbook based on building more than 60 of them. Both gave us plenty to think about—and, honestly, they also confirmed a lot of what we’ve been seeing in our own work. 

The biggest takeaway is that a good MCP server is not simply an existing API with a new wrapper. Block makes a strong case for designing from the user’s workflow backwards. Instead of exposing dozens of small endpoints and asking the model to stitch them together, it is usually better to offer a smaller set of well-named, higher-level tools that complete meaningful tasks. Tool names, descriptions, parameters, and outputs all act as instructions to the model, so clarity really matters. Fewer calls, concise responses, and actionable errors generally make the whole interaction more reliable.

That matches our experience. Long chains of tiny tool calls may look flexible on paper, but they add latency, consume context, and create more opportunities for something to go wrong. The best results often come from keeping the interface simple while handling the real complexity behind the scenes. It also helps to design around what language models do well—such as querying clean, structured data—rather than forcing them through unnecessarily complicated plans or oversized payloads. Block’s advice to watch token budgets, truncate or paginate large results, and separate read-only tools from higher-risk write operations is especially practical.

GitHub’s post adds the equally important production perspective: security and scale need to be part of the design from day one. Remote MCP servers can sit between agents and sensitive systems, so authentication alone is not enough. Tokens must be validated carefully, including their intended audience; permissions should follow least privilege; and every database query, cache lookup, and downstream request must stay scoped to the correct user. GitHub also recommends established OAuth patterns, dedicated secret-management services, workload identities, and strong observability instead of custom security shortcuts.

This strongly reflects what we have learned as well. Once an MCP server moves beyond a prototype, the less visible details become the most important ones: rate limits, caching, circuit breakers, secret rotation, structured logs, traces, health checks, and useful alerts. A gateway can centralize many of these concerns and keep them out of the core business logic.

Our shared conclusion: successful MCP servers are workflow-first, security-first, and deliberately boring—in the best possible way. When the tools are easy for the model to understand, safe for users to approve, and straightforward for teams to operate, MCP becomes far more than a demo. It becomes dependable infrastructure.