Brain Dump: AgentCore Gateway

As you build AI agents, they need to call tools: APIs, databases, services. Traditionally you'd write an MCP server for each one. Server scaffolding, tool descriptions, error handling, auth, observability, repeated across every team, every API.

TIL: You don't always need to write an MCP server

If you already have REST APIs with OpenAPI specs, AgentCore Gateway can wrap them and expose them as MCP-compatible tools automatically. Just point it at your spec and your endpoints become tools agents can call.

It also handles inbound auth (who can call the gateway) and outbound auth (how the gateway calls your backend) which are all managed by AWS.

Targets

AgentCore Gateway supports multiple target types. You can wire in AWS Lambda functions, native MCP servers and prebuilt connectors (Slack, Jira, etc. with managed OAuth). One gateway can manage multiple targets, so you end up with a single MCP endpoint that fronts many different backends.

Tool descriptions quality = agent quality

The documentation in your OpenAPI spec becomes what the agent reads to decide which tool to call and how. Vague or incomplete descriptions directly hurt agent behavior. It may pick the wrong tool or misuse parameters. So apparently, good descriptions aren't just nice to have anymore, they're part of making the agent work correctly.

Size matters in response payloads

If your REST endpoints return large, noisy payloads, that gets passed straight to the agent. This is a real concern. Bloated responses eat context window and can confuse the agent. Something to think about before wrapping an API as-is.

Request and response interceptors

AgentCore Gateway supports interceptors on both sides of a call.

Request interceptors run before the call reaches your backend. Useful for injecting auth, adding headers or modifying the request payload on the way in.

Response interceptors run before the result goes back to the agent. The main use I have in mind is trimming down fat responses so they don't bloat the agent's context. That said, I'm not sure yet if response interceptors are actually the right tool for payload trimming or if it even works well in practice. Still to be validated.

tl;dr

Agent -> AgentCore Gateway -> your REST APIs / MCP Servers

Not a silver bullet but it cuts out the MCP server grunt work if you have existing REST endpoints.