Skip to content

Commit eda7a13

Browse files
committed
Fix list tools result typings
Signed-off-by: Marcos Candeia <[email protected]>
1 parent 857b285 commit eda7a13

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

deno.lock

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mcp/server.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export const getTools = <TManifest extends AppManifest>(
190190

191191
export interface ListToolsResult {
192192
tools: Tool[];
193+
[key: string]: unknown;
193194
}
194195

195196
export type ListToolsMiddleware = RequestMiddleware<
@@ -209,7 +210,7 @@ function registerTools<TManifest extends AppManifest>(
209210
) {
210211
// Add map to store slugified names to original names
211212
let toolNames: null | Map<string, string> = null;
212-
const loadTools: ListToolsMiddleware = async (): Promise<ListToolsResult> => {
213+
const loadTools = async (): Promise<ListToolsResult> => {
213214
toolNames ??= new Map<string, string>();
214215
const meta = await deco.meta().then((v) => v?.value);
215216
if (!meta) return { tools: [] };
@@ -237,7 +238,7 @@ function registerTools<TManifest extends AppManifest>(
237238
});
238239
// Use the original name from the map when invoking
239240
if (!toolNames) {
240-
await loadTools({ request: {} });
241+
await loadTools();
241242
}
242243
const originalName = toolNames!.get(req.params.name);
243244
if (!originalName) {

0 commit comments

Comments
 (0)