Skip to content

fix(examples): migrate examples from removed listTools to mcpJsonRpc - #355

Merged
edenreich merged 2 commits into
mainfrom
fix/issue-347
Nov 17, 2026
Merged

edenreich merged 2 commits into
mainfrom
fix/issue-347

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #347

Summary

The five runnable examples still called client.listTools(), which was removed from the client in v0.25.1, and only kept starting because their package.json files pin the SDK to 0.12.x. Tool discovery now goes through the current public surface, client.mcpJsonRpc(...) with MCPJSONRPCRequestMethod.tools_list, and the docs no longer name the nonexistent EXPOSE_MCP gateway flag (the real flags are MCP_ENABLED and MCP_EXPOSE, and -e passes them into the container instead of a shell prefix that never reaches the gateway).

Changes

  • examples/list/index.ts: replaced client.listTools() with client.mcpJsonRpc({ jsonrpc: '2.0', id: 1, method: MCPJSONRPCRequestMethod.tools_list }), reading tools from response.result.tools and reporting response.error (code + message) instead of iterating the removed { data: [...] } envelope with tool.server and tool.input_schema
  • examples/mcp/agents/kubernetes, marketing, nextjs, vite: same migration in initialize() - the Context7 / Brave Search / memory / filesystem tool filters now run over the JSON-RPC tools/list result
  • examples/README.md and examples/list/README.md: tool discovery is now described through mcpJsonRpc (tools/list) and the docker command passes -e MCP_ENABLED=true -e MCP_EXPOSE=true into the container
  • examples/chat/index.ts: cast the text-only assistant response to string - pre-existing drift surfaced while type-checking, unrelated to listTools

Notes

  • Verified npm run lint, npm run build and npm test, all green.
  • Verified every example entry point (list, chat, messages, images, decisions and the four agents) type-checks against current src/ with zero errors, using temporary tsconfig.check.json files that alias @inference-gateway/sdk to src/index.ts. The check configs were removed after verification and are not committed.
  • no docs ticket: no public-facing SDK behavior changed, the SDK surface was already released in v0.25.1, and the affected example documentation is updated in this same PR.

listTools was dropped from the client in v0.25.1; the examples only kept working on stale 0.12.x pins. Tool discovery now goes through mcpJsonRpc (MCPJSONRPCRequestMethod.tools_list) and the list example texts the correct gateway flags MCP_ENABLED and MCP_EXPOSE.
…ypes

message.content can now be a multimodal content-parts array; cast the text-only assistant response to string so the example type-checks against current src exports. Surfaced while verifying issue #347, unrelated to listTools.
@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review November 17, 2026 19:18
@edenreich
edenreich merged commit d3fb472 into main Nov 17, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-347 branch November 17, 2026 19:31
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] Examples still call listTools(), removed from the client in v0.25.1

1 participant