MCPcopy Create free account
hub / github.com/ReAPI-com/mcp-openapi / setUpPrompts

Method setUpPrompts

src/McpService.ts:250–330  ·  view source on GitHub ↗
(server: McpServer)

Source from the content-addressed store, hash-verified

248 }
249
250 private setUpPrompts(server: McpServer) {
251 server.prompt(
252 "search-api-operations",
253 "Search for operations across specifications",
254 {
255 query: z.string(),
256 specId: z.string().optional(),
257 },
258 async (args, extra) => {
259 const operations = await this.specExplorer.searchOperations(
260 args.query,
261 args.specId
262 );
263 return {
264 messages: [
265 {
266 role: "user",
267 content: {
268 type: "text",
269 text: `asdf`,
270 },
271 },
272 ],
273 };
274 }
275 );
276
277 server.prompt(
278 "find-operation-by-operationId",
279 "Find an operation by specId and operationId",
280 {
281 operationId: z.string(),
282 specId: z.string(),
283 },
284 async (args, extra) => {
285 const operation = await this.specExplorer.findOperationById(
286 args.specId,
287 args.operationId
288 );
289 return {
290 messages: [
291 {
292 role: "user",
293 content: {
294 type: "text",
295 text: operation?.operation.summary ?? "",
296 },
297 },
298 ],
299 };
300 }
301 );
302
303 server.prompt(
304 "find-operation-by-path-and-method",
305 "Find an operation by path and method",
306 {
307 specId: z.string(),

Callers

nothing calls this directly

Calls 3

searchOperationsMethod · 0.65
findOperationByIdMethod · 0.65

Tested by

no test coverage detected