Skip to content

Interview question · MCP, A2A & Interoperability

Wrap your internal REST API as MCP tools: one tool per endpoint?

Endpoints are shaped for programs that already know what they want. Tools are shaped for a model deciding what to do. Generate from the API description to get started, then cut, merge and rename until each tool is one decision.

mediumEssentialNewUpdated Nov 2026

TL;DR: No. An API has endpoints for every operation a program might need, including pagination, internal ids and administrative actions; a model choosing among them makes more mistakes and pays for every definition on every turn. Design tools around the decisions an agent makes: merge endpoints that serve one decision, hide plumbing (pagination, auth, id lookups) inside the server, return trimmed results, leave out what agents must never do, and make writes idempotent with clear preconditions. Generating from the OpenAPI description is a fine first draft, not the product.

How to approach it

Explain why the mapping fails, then show the transformation on a concrete API, and finish with how you would check the result.

A strong answer

Why one-per-endpoint fails. A typical internal orders API has forty endpoints: list, get, search by six fields, update eleven attributes, cancel, refund, admin overrides, exports, health. Generated one-to-one, the model sees forty tools with names like get_v2_orders_by_id_lines, many overlapping, several dangerous, all costing tokens.

Design for decisions.

ENDPOINTS = ["GET /orders", "GET /orders/{id}", "GET /orders/{id}/lines",
             "GET /orders/search/email", "GET /orders/search/phone",
             "GET /orders/search/date",
             "PATCH /orders/{id}/address", "PATCH /orders/{id}/notes",
             "POST /orders/{id}/cancel", "POST /orders/{id}/refunds",
             "POST /admin/orders/{id}/override", "GET /admin/orders/export"]

TOOLS = {
    "orders_find": ["GET /orders", "GET /orders/search/email",
                    "GET /orders/search/phone", "GET /orders/search/date"],
    "orders_get": ["GET /orders/{id}", "GET /orders/{id}/lines"],
    "orders_update_address": ["PATCH /orders/{id}/address"],
    "orders_cancel": ["POST /orders/{id}/cancel"],
    "refunds_create": ["POST /orders/{id}/refunds"],
}
EXCLUDED = ["PATCH /orders/{id}/notes", "POST /admin/orders/{id}/override",
            "GET /admin/orders/export"]

covered = {e for es in TOOLS.values() for e in es} | set(EXCLUDED)
print(len(ENDPOINTS), len(TOOLS), covered == set(ENDPOINTS))  # => 12 5 True

Twelve endpoints become five tools, and every endpoint is accounted for: either inside a tool or deliberately excluded. Four search endpoints become one orders_find with optional filters; order and lines merge into one orders_get that returns what an agent needs; admin overrides and exports are not exposed at all.

Inside each tool.

  • Pagination, retries and id resolution happen in the server; the model passes an email, not an internal customer id.
  • Results are trimmed to what the next decision needs, with a pointer to more.
  • Writes take an idempotency key (or the server derives one) and fail with clear precondition messages ("order already shipped; use returns").
  • Descriptions say when to use the tool and when to use its neighbour.
  • Authorization uses the calling user's identity on every call.

Check it. Build a labelled set of realistic requests, measure tool-selection accuracy and task success for the generated and curated surfaces, and compare tokens per turn.

What interviewers probe next

"Generated tools keep up with the API automatically; curated ones drift." Keep the curated mapping in code next to the API, with tests that fail when an endpoint a tool uses changes, and a review when new endpoints appear.

"A power user wants the admin override through the agent." That is a separate tool for a separate role, behind approval, visible only to agents acting for users with that role.

"Should every tool have its own MCP server?" No; group by domain and owner. A server per domain with a handful of tools is easier to operate and to project.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

You curated a 40-endpoint API into eight MCP tools.

  1. Start here

    What if agents keep needing a field your trimmed result leaves out?

How it's scored

Weak: Generates one tool per endpoint from the OpenAPI file.

Hire: Merges related endpoints, hides pagination and excludes admin operations.

Strong Hire: Designs around decisions with every endpoint accounted for, puts plumbing, trimming, idempotency and per-user authorization in the server, writes descriptions that separate neighbours, keeps the mapping tested against the API, treats new endpoints as excluded by default, and measures selection accuracy and tokens.

Common mistakes

  • One tool per endpoint, including admin routes.
  • Exposing internal ids and pagination to the model.
  • Returning full API objects.
  • Auto-regenerating tools so new endpoints appear without review.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.