get_characters_for_comic
Retrieve Marvel characters associated with a specific comic by providing the comic ID. Ideal for developers and fans exploring character details in the Marvel MCP server.
Instructions
Fetch Marvel characters for a given comic
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comicId | Yes | ||
| events | No | ||
| limit | No | ||
| modifiedSince | No | ||
| name | No | ||
| nameStartsWith | No | ||
| offset | No | ||
| orderBy | No | ||
| series | No | ||
| stories | No |
Implementation Reference
- The handler function that parses input arguments using the schema, makes an HTTP request to the Marvel API endpoint for characters in a specific comic, and parses the response using CharacterDataWrapperSchema.handler: async (args: any) => { const { comicId, ...rest } = GetComicCharactersSchema.parse(args); const res = await httpRequest(`/comics/${comicId}/characters`, serializeQueryParams(rest)); return CharacterDataWrapperSchema.parse(res); }
- Zod schema defining the input parameters for the get_characters_for_comic tool, extending GetComicByIdSchema with additional optional filters for characters.export const GetComicCharactersSchema = GetComicByIdSchema.extend({ name: z.string().optional(), nameStartsWith: z.string().optional(), modifiedSince: z.string().optional(), series: z.string().optional(), events: z.string().optional(), stories: z.string().optional(), orderBy: z.string().optional(), limit: z.number().min(1).max(100).optional(), offset: z.number().optional(), });
- src/tools/get_characters_for_comic/index.ts:6-14 (registration)Exports the tool definition object including description, input schema, and handler function, likely used for MCP tool registration.export const get_characters_for_comic = { description: `Fetch Marvel characters for a given comic.`, schema: GetComicCharactersSchema, handler: async (args: any) => { const { comicId, ...rest } = GetComicCharactersSchema.parse(args); const res = await httpRequest(`/comics/${comicId}/characters`, serializeQueryParams(rest)); return CharacterDataWrapperSchema.parse(res); } };