get_comic_by_id
Retrieve detailed information about a specific Marvel comic using its unique ID through the Marvel MCP server.
Instructions
Fetch a single Marvel comic by ID
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"comicId": "<comicId>"
},
"name": "get_comic_by_id"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comicId | Yes |
Implementation Reference
- src/tools/get_comic_by_id/index.ts:9-13 (handler)The handler function that parses the input arguments, fetches the comic data via HTTP request using the provided comicId, parses the response with ComicDataWrapperSchema, and returns it.
handler: async (args: any) => { const argsParsed = GetComicByIdSchema.parse(args); const res = await httpRequest(`/comics/${argsParsed.comicId}`); return ComicDataWrapperSchema.parse(res); } - Zod schema defining the input parameters for the tool: a required numeric comicId.
export const GetComicByIdSchema = z.object({ comicId: z.number(), }); - src/tools/get_comic_by_id/index.ts:6-14 (registration)The tool registration exporting the get_comic_by_id tool object with description, input schema, and handler function.
export const get_comic_by_id = { description: `Fetch a single Marvel comic by ID.`, schema: GetComicByIdSchema, handler: async (args: any) => { const argsParsed = GetComicByIdSchema.parse(args); const res = await httpRequest(`/comics/${argsParsed.comicId}`); return ComicDataWrapperSchema.parse(res); } };