mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
fix(MCPService): Tool call failure caused by incorrect tool parameters
This commit is contained in:
parent
6ba1e898c2
commit
38830d34aa
@ -394,6 +394,13 @@ class McpService {
|
||||
): Promise<MCPCallToolResponse> {
|
||||
try {
|
||||
Logger.info('[MCP] Calling:', server.name, name, args)
|
||||
if (typeof args === 'string') {
|
||||
try {
|
||||
args = JSON.parse(args)
|
||||
} catch (e) {
|
||||
Logger.error('[MCP] args parse error', args)
|
||||
}
|
||||
}
|
||||
const client = await this.initClient(server)
|
||||
const result = await client.callTool({ name, arguments: args }, undefined, {
|
||||
timeout: server.timeout ? server.timeout * 1000 : 60000 // Default timeout of 1 minute
|
||||
|
||||
@ -68,7 +68,7 @@ const PipRegistry: Registry[] = [
|
||||
{ name: '腾讯云', url: 'https://mirrors.cloud.tencent.com/pypi/simple/' }
|
||||
]
|
||||
|
||||
type TabKey = 'settings' | 'tools' | 'prompts' | 'resources'
|
||||
type TabKey = 'settings' | 'description' | 'tools' | 'prompts' | 'resources'
|
||||
|
||||
const parseKeyValueString = (str: string): Record<string, string> => {
|
||||
const result: Record<string, string> = {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user