refactor: add sdk tool type exports
This commit is contained in:
23
src/entrypoints/sdk/toolTypes.ts
Executable file → Normal file
23
src/entrypoints/sdk/toolTypes.ts
Executable file → Normal file
@@ -1 +1,22 @@
|
|||||||
export {}
|
import type { CallToolResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'
|
||||||
|
|
||||||
|
import type { AnyZodRawShape, InferShape, SdkMcpToolDefinition } from './runtimeTypes.ts'
|
||||||
|
|
||||||
|
export type { AnyZodRawShape, InferShape, SdkMcpToolDefinition }
|
||||||
|
|
||||||
|
export type SdkMcpToolHandler<Schema extends AnyZodRawShape> = (
|
||||||
|
args: InferShape<Schema>,
|
||||||
|
extra: unknown,
|
||||||
|
) => Promise<CallToolResult>
|
||||||
|
|
||||||
|
export type SdkMcpToolExtras = {
|
||||||
|
annotations?: ToolAnnotations
|
||||||
|
searchHint?: string
|
||||||
|
alwaysLoad?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SdkMcpToolDescriptor<Schema extends AnyZodRawShape> = Pick<
|
||||||
|
SdkMcpToolDefinition<Schema>,
|
||||||
|
'name' | 'description' | 'inputSchema' | 'handler'
|
||||||
|
> &
|
||||||
|
SdkMcpToolExtras
|
||||||
|
|||||||
Reference in New Issue
Block a user