(
name,
toolConfig,
callback,
)
| 446 | }; |
| 447 | |
| 448 | const registerApp: ExecutorMcpAssembly<McpServer, McpServerRequestContext>["registerAppTool"] = ( |
| 449 | name, |
| 450 | toolConfig, |
| 451 | callback, |
| 452 | ) => { |
| 453 | const inputSchema = z.object(toolConfig.inputSchema); |
| 454 | const metadata = normalizedAppMetadata(toolConfig._meta); |
| 455 | if (!sessionful && !config.appsEnabled && visibilityIncludes(metadata, "model")) { |
| 456 | const plainMetadata = withoutAppMetadata(metadata); |
| 457 | return server.registerTool<z.ZodObject<z.ZodRawShape>, typeof inputSchema>( |
| 458 | name, |
| 459 | { |
| 460 | ...toolConfig, |
| 461 | inputSchema, |
| 462 | ...(Object.keys(plainMetadata).length === 0 |
| 463 | ? { _meta: undefined } |
| 464 | : { _meta: plainMetadata }), |
| 465 | }, |
| 466 | async (args, context) => toolResult(await callback(args, requestJoinKeys(context))), |
| 467 | ); |
| 468 | } |
| 469 | |
| 470 | return registerAppTool<typeof inputSchema, z.ZodObject<z.ZodRawShape>>( |
| 471 | server, |
| 472 | name, |
| 473 | { ...toolConfig, inputSchema, _meta: metadata }, |
| 474 | async (args, context) => toolResult(await callback(args, requestJoinKeys(context))), |
| 475 | ); |
| 476 | }; |
| 477 | |
| 478 | const nativeInputRequired = async <NativeE extends Cause.YieldableError>( |
| 479 | services: NativeExecutionServices<NativeE, McpServerRequestContext>, |
nothing calls this directly
no test coverage detected