// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

import { z } from 'zod';

import { NotFoundError } from '../core/errors.js';
import { getEndpoint, type Store } from '../data/store-repository.js';

export const getInputShape = {
  operationId: z.string().min(1).describe('operationId returned by search'),
};

/** Returns the literal schema, path, method, and documentation for a
 * specific operationId (PRD §1.5). */
export async function getOperation(store: Store, operationId: string) {
  const endpoint = getEndpoint(store, operationId);
  if (!endpoint) {
    throw new NotFoundError(`unknown operationId '${operationId}'`);
  }
  return endpoint;
}
