UNPKG

pocketsmith-mcp

Version:

MCP server for managing budgets via PocketSmith API

39 lines (38 loc) 1.54 kB
/** * @fileoverview Defines the core logic, schemas, and types for the `echo` resource. * This module includes a Zod schema for query parameter validation, type definitions, * and the main processing function that constructs the resource response. * @module src/mcp-server/resources/echoResource/echoResourceLogic */ 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>;