<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gino Tesei</title>
    <description>The latest articles on DEV Community by Gino Tesei (@gtesei).</description>
    <link>https://dev.to/gtesei</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3930355%2F030fed05-c0c1-433d-bc6c-8ed7743881d4.jpeg</url>
      <title>DEV Community: Gino Tesei</title>
      <link>https://dev.to/gtesei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gtesei"/>
    <language>en</language>
    <item>
      <title>Turning OpenAPI Specs into Runtime LLM Tools in Pi</title>
      <dc:creator>Gino Tesei</dc:creator>
      <pubDate>Thu, 14 May 2026 03:12:34 +0000</pubDate>
      <link>https://dev.to/gtesei/turning-openapi-specs-into-runtime-llm-tools-in-pi-6n9</link>
      <guid>https://dev.to/gtesei/turning-openapi-specs-into-runtime-llm-tools-in-pi-6n9</guid>
      <description>&lt;p&gt;I built &lt;a href="https://github.com/gtesei/pi-openapi-tools" rel="noopener noreferrer"&gt;pi-openapi-tools&lt;/a&gt; — a Pi extension that reads an OpenAPI/Swagger spec and dynamically registers one callable tool per API operation.&lt;/p&gt;

&lt;p&gt;Instead of hand-writing wrappers for every endpoint, you point Pi at a spec URL and immediately start using generated tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/pi-openapi-tools?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;pi-openapi-tools on npm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pi package: &lt;a href="https://pi.dev/packages/pi-openapi-tools?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;pi-openapi-tools on Pi&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/gtesei/pi-openapi-tools?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Repository&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Why I built this&lt;/p&gt;

&lt;p&gt;Most API-agent integrations still require too much manual glue code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mapping endpoints to functions&lt;/li&gt;
&lt;li&gt;defining parameter schemas&lt;/li&gt;
&lt;li&gt;maintaining naming consistency&lt;/li&gt;
&lt;li&gt;wiring auth/token handling&lt;/li&gt;
&lt;li&gt;repeating the process for every API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That slows experimentation and makes agent tooling fragile.&lt;/p&gt;

&lt;p&gt;I wanted a runtime-first workflow:&lt;/p&gt;

&lt;p&gt;spec → generated tools → live API calls&lt;/p&gt;




&lt;p&gt;What the extension does&lt;/p&gt;

&lt;p&gt;Given an OpenAPI or Swagger spec URL, pi-openapi-tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generates one Pi tool per operation&lt;/li&gt;
&lt;li&gt;Supports Swagger 2.0 and OpenAPI 3.x&lt;/li&gt;
&lt;li&gt;Builds structured parameter schemas automatically&lt;/li&gt;
&lt;li&gt;Resolves request bodies by media/content type&lt;/li&gt;
&lt;li&gt;Handles path, query, and header params&lt;/li&gt;
&lt;li&gt;Adds slash commands for managing generated toolsets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prefix-scoped registrations (&lt;code&gt;/swagger-tools:list-prefixes&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;prefix cleanup (&lt;code&gt;/swagger-tools:remove-prefix&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;tool inspection (&lt;code&gt;/swagger-tools:describe&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;token/auth helpers (&lt;code&gt;/swagger-tools:auth&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;60-second quickstart&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pi &lt;span class="nb"&gt;install &lt;/span&gt;npm:pi-openapi-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate tools from Petstore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/swagger-tools https://petstore.swagger.io/v2/swagger.json --prefix pet
/swagger-tools:list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll immediately get generated tools such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pet_getstoreorderbyid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pet_postuser&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;A few implementation details mattered a lot in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Prefix-scoped additive registration&lt;br&gt;
Multiple API toolsets can coexist cleanly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stable naming + dedupe&lt;br&gt;
Generated names are sanitized and collision-safe.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No unregister support in Pi? Stub instead.&lt;br&gt;
Removed tools become non-executable guidance stubs instead of silently disappearing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Content-type-aware serialization&lt;br&gt;
Request body handling follows declared spec media types (JSON, form-data, urlencoded, text, etc).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I also added a full walkthrough + simulation test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tutorial: &lt;a href="https://github.com/gtesei/pi-openapi-tools/blob/main/docs/swagger-petstore-tutorial.md?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Petstore walkthrough&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/gtesei/pi-openapi-tools?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you try it on large or messy specs, I’d especially love feedback on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;operation naming ergonomics&lt;/li&gt;
&lt;li&gt;auth edge cases&lt;/li&gt;
&lt;li&gt;request body/media handling&lt;/li&gt;
&lt;li&gt;discoverability in very large APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this is useful, feel free to star the repo and share your API use case.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
