Skip to content

Commit b2a784a

Browse files
committed
chore: update pnpm lockfile for modelcontextprotocoltools dependencies
1 parent 6faf372 commit b2a784a

File tree

1 file changed

+9
-11
lines changed
  • provider/modelcontextprotocoltools

1 file changed

+9
-11
lines changed

provider/modelcontextprotocoltools/index.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { basename } from 'node:path'
22
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
33
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
4-
import {
5-
CallToolResultSchema,
6-
7-
} from '@modelcontextprotocol/sdk/types.js'
4+
import { CallToolResultSchema } from '@modelcontextprotocol/sdk/types.js'
85
import type {
96
Item,
107
ItemsParams,
@@ -94,12 +91,12 @@ class MCPToolsProxy implements Provider {
9491
for (const tool of tools) {
9592
// Store the schema in the Map using tool name as key
9693
this.toolSchemas.set(tool.name, JSON.stringify(tool.inputSchema))
97-
94+
9895
const r = {
9996
uri: tool.uri,
10097
title: tool.name,
10198
description: tool.description,
102-
data: (tool.inputSchema),
99+
data: tool.inputSchema,
103100
} as Mention
104101
mentions.push(r)
105102
}
@@ -147,7 +144,9 @@ class MCPToolsProxy implements Provider {
147144
const isValid = this.ajv.validate(schema, toolInput)
148145
if (!isValid) {
149146
console.error('Invalid tool input:', this.ajv.errors)
150-
throw new Error(`Invalid input for tool ${toolName}: ${JSON.stringify(this.ajv.errors)}`)
147+
throw new Error(
148+
`Invalid input for tool ${toolName}: ${JSON.stringify(this.ajv.errors)}`,
149+
)
151150
}
152151
}
153152
}
@@ -156,14 +155,14 @@ class MCPToolsProxy implements Provider {
156155
const response = await mcpClient.request(
157156
{
158157
method: 'tools/call' as const,
159-
params: {
158+
params: {
160159
name: toolName,
161-
arguments: toolInput
160+
arguments: toolInput,
162161
},
163162
},
164163
CallToolResultSchema,
165164
)
166-
165+
167166
const contents = response.content
168167
const items: Item[] = []
169168
for (const content of contents) {
@@ -190,6 +189,5 @@ class MCPToolsProxy implements Provider {
190189
}
191190
}
192191

193-
194192
const proxy = new MCPToolsProxy()
195193
export default proxy

0 commit comments

Comments
 (0)