Skip to main content
Glama

docs-mcp-server

cancel.tsx1.07 kB
import type { FastifyInstance } from "fastify"; import type { CancelJobTool } from "../../../tools/CancelJobTool"; import { ToolError } from "../../../tools/errors"; /** * Registers the API route for cancelling jobs. * @param server - The Fastify instance. * @param cancelJobTool - The tool instance for cancelling jobs. */ export function registerCancelJobRoute( server: FastifyInstance, cancelJobTool: CancelJobTool ) { // POST /web/jobs/:jobId/cancel - Cancel a job by ID server.post<{ Params: { jobId: string } }>( "/web/jobs/:jobId/cancel", async (request, reply) => { const { jobId } = request.params; try { await cancelJobTool.execute({ jobId }); return { success: true, message: "Job cancelled successfully" }; } catch (error) { if (error instanceof ToolError) { reply.status(400); return { success: false, message: error.message }; } else { reply.status(500); return { success: false, message: "Internal server error" }; } } } ); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arabold/docs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server