UNPKG

mcp-ts-template

Version:

A production-grade TypeScript template for building robust Model Context Protocol (MCP) servers, featuring built-in observability with OpenTelemetry, advanced error handling, comprehensive utilities, and a modular architecture.

38 lines 1.52 kB
/** * @fileoverview Defines the core logic, schemas, and types for the `echo` resource. * @module src/mcp-server/resources/echoResource/logic * @see {@link src/mcp-server/resources/echoResource/registration.ts} for the handler and registration logic. */ import { z } from "zod"; import { type RequestContext } from "../../../utils/index.js"; /** * Zod schema defining expected query parameters for the echo resource. */ export declare const EchoResourceQuerySchema: z.ZodObject<{ message: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { message?: string | undefined; }, { message?: string | undefined; }>; /** * TypeScript type inferred from the {@link EchoResourceQuerySchema}. */ export type EchoResourceParams = z.infer<typeof EchoResourceQuerySchema>; /** * Defines the structure of the JSON payload returned by the `processEchoResource` function. */ export interface EchoResourceResponsePayload { message: string; timestamp: string; requestUri: string; } /** * Processes the core logic for an echo resource request. * @param uri - The full URL object of the incoming resource request. * @param params - The validated query parameters for the request. * @param context - The request context, used for logging and tracing the operation. * @returns The data payload for the response. */ export declare function echoResourceLogic(uri: URL, params: EchoResourceParams, context: RequestContext): Promise<EchoResourceResponsePayload>; //# sourceMappingURL=logic.d.ts.map