Skip to content

chore(examples): raise example SDK pins to the current release line - #356

Merged
edenreich merged 7 commits into
mainfrom
fix/issue-348
Nov 17, 2026
Merged

edenreich merged 7 commits into
mainfrom
fix/issue-348

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #348

Closes #347 - the listTools migration that #348 required from it is included here, and all of #347's acceptance criteria are met.

Summary

Every example pinned a caret range on a 0.x version, which npm treats as minor-breaking, so nothing ever upgraded: ^0.12.0 resolved to 0.12.x and ^0.15.0 to 0.15.x while the current SDK is 0.30.0. Three examples called APIs their own pin could not install, and the rest kept exercising a client surface from 18 releases ago. This raises every example to ^0.30.0 and migrates the code that breaks on the newer types, including the listTools() removal fixes #348 required from #347.

Changes

  • all example package.json files (images, decisions, list, chat, messages and the four mcp agents): @inference-gateway/sdk raised to ^0.30.0, and the six tracked package-lock.json files regenerated so they resolve 0.30.0
  • examples/chat/index.ts: the response message content is narrowed to a string before being pushed back into the conversation, since content is now string or content part[]
  • examples/list/index.ts and examples/mcp/agents (kubernetes, marketing, nextjs, vite): the removed client.listTools() is replaced by client.mcpJsonRpc() tools_list calls, namespaced tool names are matched by suffix, and the JSON-RPC error envelope is reported instead of swallowed
  • examples/list hints and README: the gateway flags are MCP_ENABLED and MCP_EXPOSE - the old EXPOSE_MCP=true shell prefix on docker run never reached the container, so the command now passes -e MCP_ENABLED=true -e MCP_EXPOSE=true
  • examples/mcp/agents Dockerfiles: Node 24 base images, since the SDK requires engines.node >= 24.15.0 but the images installed Node 18 (kubernetes) and Node 20 (marketing, nextjs, vite)
  • examples/package.json: install-all now also installs images and decisions
  • examples/messages/README.md: the required-version note now says >= 0.30.0, matching the range actually installed

Validation

  • npm install in all nine example directories; the lockfiles resolve 0.30.0
  • npx tsc --noEmit for chat, list, messages, images and decisions against the published 0.30.0 types: all pass
  • the four MCP agents type-check with the same compiler flags via the marketing agent's typescript: all pass
  • markdownlint passes on the three edited READMEs
  • note: without --types node every example tsconfig reports pre-existing TS2591 (process not found), because each tsconfig excludes node_modules and therefore never auto-discovers node types; a transient --no-save @types/node install (no tracked changes) proved the examples are type-clean

Example-only changes - no schema, SDK surface or release ripple to other repos.

Docs follow-up tracking: inference-gateway/docs#1260

All example packages pinned ^0.12.0 or ^0.15.0; for 0.x versions npm treats the minor as breaking so examples resolved to stale 0.12.x/0.15.x builds and three of them could not even install APIs they call. Bump every example to ^0.30.0, regenerate lockfiles, and include images and decisions in install-all.
With the current SDK installed the previous calls no longer exist: listTools() was removed from the client in v0.25.1, so examples/list and the four MCP agents now discover tools through client.mcpJsonRpc() with the tools_list method and match namespaced tool names by suffix, and the MCP hint text names the real MCP_ENABLED and MCP_EXPOSE gateway flags. examples/chat narrows the response message content to a string before pushing it back into the conversation, since message content is now string or content parts.
The SDK declares engines.node >= 24.15.0 and npm install in the agent images warns or breaks when the base image ships an older runtime. The kubernetes agent installed Node 18 and the marketing, nextjs and vite agents installed Node 20 - both now install Node 24.
The messages README pins its note to the range actually installed (^0.30.0), the list README tells readers to start the gateway with MCP_ENABLED and MCP_EXPOSE flags on docker run instead of an EXPOSE_MCP shell prefix that never reaches the container, and the tool discovery descriptions refer to the MCP JSON-RPC endpoint rather than a removed tools listing method.
A JSON-RPC error envelope comes back as response.error whatever the HTTP status, and the tools/list result is empty in that case - print its code and message before the MCP_ENABLED/MCP_EXPOSE hint instead of swallowing it.
@edenreich

Copy link
Copy Markdown
Contributor

@claude can you resolve the merge conflict?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 1m 32s —— View job


Merge conflict resolved

  • Fetch main and find conflicts
  • Resolve conflicts
  • Create merge commit via GitHub API and move the branch

I merged main into fix/issue-348 with merge commit b055d1f. Its parents are cc7dcba (this PR) and d3fb472 (main). Main had picked up #352, #353 and #355, and #355 makes the same listTools to mcpJsonRpc change as this PR, so 9 files conflicted. Here is how I resolved each one:

File Kept Why
examples/README.md, examples/list/README.md main Same meaning on both sides. Main puts each bullet on one line, and its docker run has --env-file before the -e flags.
examples/list/index.ts main Main checks response.error before it reads result.tools. This PR's version printed "Found 0 MCP tools" first and only then the error. One thing is lost: this PR also printed inputSchema.
examples/chat/index.ts this PR typeof tutorReply === 'string' really checks the type. Main's as string cast would let a content part array through.
examples/mcp/agents/{kubernetes,marketing,nextjs,vite}/index.ts this PR The toolsNamed helper matches tool names by suffix, so it works whatever prefix the gateway adds. Main matches the exact names c41_... and only works when the prefix is exactly c41_.
examples/mcp/agents/vite/index.ts this PR, plus main's baseURL Keeps the http://inference-gateway:8080/v1 change from #353.
examples/package.json main, plus this PR's images/decisions installs #353 removed cd ../mcp and the mcp:* scripts because examples/mcp has no package.json. So install-all now ends at decisions.

All other files merged automatically. I checked that the tree on GitHub has the same SHA as my local merge (5148f38).

I didn't run tsc on the merged examples, and the PR description still says install-all installs mcp, which is no longer true. GitHub was still recalculating whether the PR can merge when I finished.
• fix/issue-348

@edenreich

Copy link
Copy Markdown
Contributor

@claude can you resolve the merge conflict?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 58s —— View job


Merge conflict resolved

  • Fetch main and find conflicts
  • Resolve conflicts
  • Create merge commit via GitHub API and move the branch

The earlier merge (b055d1f) was fine. The new conflict came from #354, which landed on main after it and added the examples/audio example. I merged main into fix/issue-348 again with merge commit 36bdfa2. Its parents are b055d1f (this PR) and 479cfb7 (main).

Only examples/package.json conflicted, and only on the install-all line. Each side had added different directories, so I kept both: install-all now installs list, chat, messages, images, decisions and audio. Everything else from #354 merged cleanly. examples/audio/package.json already pins @inference-gateway/sdk at ^0.30.0, so it fits this PR as it is.

The tree on GitHub has the same SHA as my local merge (9642dbf). The branch is now 7 commits ahead of main and 0 behind.

I didn't run npm install or tsc on the merged examples. The PR description doesn't mention the audio example.
• fix/issue-348

@edenreich
edenreich merged commit d2d81c3 into main Nov 17, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-348 branch November 17, 2026 19:39
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 17, 2026
## [0.31.0](v0.30.0...v0.31.0) (2026-11-17)

### ✨ Features

* sync generated types with schemas v1.14.1 ([#357](#357)) ([c1ac248](c1ac248))

### 🐛 Bug Fixes

* **examples:** align gateway env vars with the openapi x-config spec ([#352](#352)) ([ad88612](ad88612))
* **examples:** migrate examples from removed listTools to mcpJsonRpc ([#355](#355)) ([d3fb472](d3fb472)), references [#347](#347)

### 👷 CI

* align Dependabot schedule and grouping ([#344](#344)) ([c4e6a3e](c4e6a3e))
* **deps-dev:** bump the npm group with 3 updates ([#345](#345)) ([2882a46](2882a46))
* set up orchestrators from repos.yaml ([#346](#346)) ([53394ea](53394ea))

### 📚 Documentation

* **examples:** add audio examples for createSpeech, createSFX and createMusic ([#354](#354)) ([479cfb7](479cfb7))
* **examples:** fix run instructions referencing missing files, scripts and services ([#353](#353)) ([87f9d8d](87f9d8d))

### 🔧 Miscellaneous

* **deps:** bump flox dependencies to latest ([#342](#342)) ([60b715d](60b715d))
* **deps:** bump flox dependencies to latest ([#343](#343)) ([cf43b42](cf43b42))
* **examples:** raise example SDK pins to the current release line ([#356](#356)) ([d2d81c3](d2d81c3))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Example packages pin an SDK version older than the APIs they call [DOCS] Examples still call listTools(), removed from the client in v0.25.1

1 participant