@codewithdan/marvel-mcp
Version:
Marvel APIs MCP Server demo
14 lines (13 loc) • 532 B
JavaScript
// src/tools/get_comic_by_id/index.ts
import { ComicDataWrapperSchema } from "../schemas.js";
import { httpRequest } from "../../utils.js";
import { GetComicByIdSchema } from "./schemas.js";
export const get_comic_by_id = {
description: `Fetch a single Marvel comic by ID.`,
schema: GetComicByIdSchema,
handler: async (args) => {
const argsParsed = GetComicByIdSchema.parse(args);
const res = await httpRequest(`/comics/${argsParsed.comicId}`);
return ComicDataWrapperSchema.parse(res);
}
};