Unlocking Innovation with Agoda’s Zero-Code API Agent
In today’s rapidly evolving digital landscape, managing multiple APIs can become a cumbersome task, especially for teams aiming to leverage AI technologies for internal tools. Agoda’s engineers have responded to this challenge with the introduction of the API Agent, a groundbreaking system designed to eliminate the operational overhead of handling diverse API architectures. By utilizing a single Model Context Protocol (MCP) server, teams can seamlessly connect to various internal REST or GraphQL APIs without any need for coding or complex deployments.
What is the API Agent?
The API Agent serves as a universal MCP server, simplifying the process of integrating numerous APIs. When engineers configure the MCP client, they identify the target URL and specify the API type. The magic happens when the agent automatically introspects the API schema, generating queries tailored to natural language inputs. This innovative system allows a single deployment to cater to multiple APIs concurrently, presenting each API as its own MCP server, all while sharing the same underlying instance. Adding new APIs is a breeze—only a configuration update is necessary.
Quotes from Leadership
Idan Zalzberg, the Chief Technology Officer at Agoda, shed light on the transformative potential of the API Agent during a recent press release:
“Many teams want to unlock internal tools for AI, but writing MCPs for each one is a major effort. API Agent takes a novel, zero-effort approach to that transformation, and to our knowledge, is the first of its kind.”
Architecture and Design
The architecture of the API Agent includes a schema introspection module that dynamically retrieves the API schema once configured with the target API. For GraphQL APIs, it intelligently extracts types, fields, and input parameters, while for REST APIs, it leverages OpenAPI specifications or JSON response examples. This capability enables the agent to construct queries on-the-fly without reliance on prebuilt adapters, streamlining the integration process significantly.
Technical Stack
The technical stack supporting the API Agent comprises crucial components such as FastMCP for the MCP server, the OpenAI Agents SDK for orchestrating language models, and DuckDB for in-memory SQL post-processing. Additional features, such as dynamic tool naming, elaborate schema searches for intricate APIs, and turn tracking for multi-step queries, further enhance user experience. Furthermore, observability is achieved through tools like OpenTelemetry, Jaeger, Zipkin, Grafana Tempo, and Arize Phoenix, enabling robust monitoring and analytics.
Handling Large API Responses
One of the standout features of the API Agent is its adeptness at managing large API responses that may exceed the context limits of large language models (LLMs). By using DuckDB as a context-management layer, the API Agent stores, filters, and aggregates full API responses in SQL, sending only concise results back to the model. DuckDB operates in-process, natively handles JSON, and automatically infers schemas, ensuring efficient and safe data handling during query generation.
Security Measures Embedded in the API Agent
Security is a top priority for the API Agent, which operates solely in read-only mode by default. Mutations are blocked unless specifically enabled and whitelisted for internal tools, providing peace of mind to users concerned about data security. This approach safeguards against unauthorized changes, ensuring that the integrity of internal tools remains intact.
Operational Insights from Development
Through the development process, several operational lessons emerged. Key takeaways include the importance of clear communication when responses are truncated, prioritizing schema discovery over sample data, managing SQL quirks effectively, and providing detailed error messages to assist in LLM corrections. The API Agent can also capture repetitive queries as parameterized “recipes,” significantly reducing reasoning time and latency for future requests.
Advanced Query Capabilities
Additionally, the API Agent supports complex queries across multiple endpoints within a single session. It can handle joins and aggregations, which means users can dive deep into data analytics without the worry of sandboxing, network isolation, or dependency issues. Its declarative style resonates with large language models, enabling safe and effective AI-assisted data transformations, ensuring that users can extract valuable insights with ease.
Open Source Initiative
For those eager to explore, the API Agent project is open-sourced, allowing for experimentation with both REST and GraphQL frameworks. This move towards transparency not only promotes collaboration within the tech community but also fosters innovation, encouraging developers to contribute and refine this groundbreaking tool.
API Agent under the hood (Source: Agoda Engineering Blog)
API Agent security model (Source: Agoda Engineering Blog)
Inspired by: Source



