---
title: "Comment by Osama Malik on \"How to Turn an OpenAPI Spec Into an MCP Server (Without Giving Agents Every Endpoint)\" | Hashnode"
description: "Agree on grouping into task-shaped tools. One addition: when a tool wraps two endpoints, make the write step idempotent or require an explicit id returned by th"
url: "https://hashnode.com/posts/openapi-spec-to-mcp-server/6b069f33298713927b784058/comment/6b06df06f1c49ed588f5a8f2"
---

[Discussion](https://hashnode.com/posts/openapi-spec-to-mcp-server/6b069f33298713927b784058)

Comment [How to Turn an OpenAPI Spec Into an MCP Server (Without Giving Agents Every Endpoint)](https://hashnode.com/posts/openapi-spec-to-mcp-server/6b069f33298713927b784058)

[Osama Malik](https://hashnode.com/@osamamalik)

[2h ago](https://hashnode.com/posts/openapi-spec-to-mcp-server/6b069f33298713927b784058/comment/6b06df06f1c49ed588f5a8f2)

Agree on grouping into task-shaped tools. One addition: when a tool wraps two endpoints, make the write step idempotent or require an explicit id returned by the read step, because agents sometimes retry a call after a timeout and a plain POST then creates a duplicate. Also keep the tool result small and structured (only the fields the task needs), since large raw API responses eat context and can carry text from user-generated fields that the model may treat as instructions.
