refactor: move tunnel and respond into core
This commit is contained in:
1 parent
c1c0e3383b
commit
dd99f4a47b
8 files changed
+9
-6
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'
|
||||
|
||||
export const ok = (payload: unknown): CallToolResult => ({
|
||||
content: [{ type: 'text', text: JSON.stringify(payload) }]
|
||||
})
|
||||
|
||||
export const fail = (message: string): CallToolResult => ({
|
||||
content: [{ type: 'text', text: message }],
|
||||
isError: true
|
||||
})
|
||||
|
||||
export const errorMessage = (error: unknown): string =>
|
||||
error instanceof Error ? error.message : String(error)
|
||||
Reference in new issue
Block a user