Replies: 1 comment
-
To address the OpenAPI spec quality related challenges we could create an LLM based utility which could review an existing spec and then point out shortcomings in the spec which could then be corrected by a human developer and also provide a proposed rewrite of the spec to address the shortcomings. This rewrite can then be used to generate an MCP server. A prompt template for the same is attached. Good: https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml Not so good: https://github.com/aws-samples/multi-agent-code-gen-and-execution/blob/main/data/doorbell_openapi_spec.json |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Have seen request from at least one customer where they are interested in MCP'fying their existing APIs and would like the Gateway to provide a functionality to create an MCP server given an existing API spec (and then have the server accessible via the Gateway and discoverable via the Registry).
Converting an existing OpenAPI spec to an MCP server is a functionality that is already provided by the Pydantic FastMCP 2.0 package, see quickstart.
A common challenge to converting an OpenAPI spec is that often times the spec may not have sufficient amount of detail to create a good tool spec. This is important because while existing API specs are written for human developers but MCP tool specs are written for LLMs, the point being that a human developer can fill in the gaps (use their expertise, domain knowledge, tribal knowledge within an organization) in a spec that may not be sufficiently detailed but an LLM would be prone to hallucination and may not be able to select the right tool or pass the right parameters to the tool.
Beta Was this translation helpful? Give feedback.
All reactions