Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit f7d83b1

Browse files
committed
fix tool types
1 parent e9666dd commit f7d83b1

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

packages/mcp-use/src/server/mcp-server.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,7 @@ export class McpServer {
112112
inputSchema,
113113
async (params: any) => {
114114
const result = await definition.fn(params)
115-
return {
116-
content: [
117-
{
118-
type: 'text',
119-
text: result,
120-
},
121-
],
122-
}
115+
return result
123116
},
124117
)
125118
return this

packages/mcp-use/src/server/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Removed unused import
2-
import type {UIResource} from '@mcp-ui/server'
1+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'
32
export interface ServerConfig {
43
name: string
54
version: string
@@ -46,5 +45,5 @@ export interface PromptDefinition {
4645

4746
export type ResourceHandler = () => Promise<string>
4847
export type TemplateHandler = (params: Record<string, string>) => Promise<string>
49-
export type ToolHandler = (params: Record<string, any>) => Promise<string| UIResource>
48+
export type ToolHandler = (params: Record<string, any>) => Promise<CallToolResult>
5049
export type PromptHandler = (params: Record<string, any>) => Promise<string>

0 commit comments

Comments
 (0)