Skip to main content
Glama
8enSmith

mcp-open-library

get_author_photo

Retrieve the URL for an author's photo by providing their Open Library Author ID (OLID). Use this tool to access visual profiles of authors for enhanced book-related searches.

Instructions

Get the URL for an author's photo using their Open Library Author ID (OLID e.g. OL23919A).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
olidYesThe Open Library Author ID (OLID) for the author (e.g. OL23919A).

Implementation Reference

  • The main handler function that parses arguments using the schema, validates the OLID, constructs the photo URL from Open Library API, and returns it as text content.
    const handleGetAuthorPhoto = async (args: unknown): Promise<CallToolResult> => {
      const parseResult = GetAuthorPhotoArgsSchema.safeParse(args);
    
      if (!parseResult.success) {
        const errorMessages = parseResult.error.errors
          .map((e) => `${e.path.join(".")}: ${e.message}`)
          .join(", ");
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid arguments for get_author_photo: ${errorMessages}`,
        );
      }
    
      const olid = parseResult.data.olid;
      const photoUrl = `https://covers.openlibrary.org/a/olid/${olid}-L.jpg`; // Use -L for large size
    
      // Note: We don't actually fetch the image here, just return the URL.
      // The Open Library Covers API doesn't provide a way to check if an image exists
      // other than trying to fetch it. We assume the URL is correct if the OLID format is valid.
    
      return {
        content: [
          {
            type: "text",
            text: photoUrl,
          },
        ],
      };
      // No try/catch needed here as we are just constructing a URL string based on validated input.
    };
  • Zod schema defining and validating the 'olid' input parameter for the get_author_photo tool.
    export const GetAuthorPhotoArgsSchema = z.object({
      olid: z
        .string()
        .min(1, { message: "OLID cannot be empty" })
        .regex(/^OL\d+A$/, {
          // Escaped backslash for regex in string
          message: "OLID must be in the format OL<number>A",
        }),
    });
  • src/index.ts:99-113 (registration)
    Tool registration in the listTools handler, providing name, description, and input schema for MCP discovery.
    {
      name: "get_author_photo",
      description:
        "Get the URL for an author's photo using their Open Library Author ID (OLID e.g. OL23919A).",
      inputSchema: {
        type: "object",
        properties: {
          olid: {
            type: "string",
            description:
              "The Open Library Author ID (OLID) for the author (e.g. OL23919A).",
          },
        },
        required: ["olid"],
      },
  • src/index.ts:176-177 (registration)
    Dispatcher in callTool handler that routes requests for 'get_author_photo' to the handler function.
    case "get_author_photo":
      return handleGetAuthorPhoto(args);
  • src/index.ts:12-19 (registration)
    Import of the get_author_photo handler from the tools module.
    import {
      handleGetAuthorPhoto,
      handleGetBookByTitle,
      handleGetBookCover,
      handleGetAuthorsByName,
      handleGetAuthorInfo,
      handleGetBookById,
    } from "./tools/index.js";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a URL, which is useful, but lacks details on error handling (e.g., if the OLID is invalid), rate limits, authentication needs, or whether the operation is read-only (implied but not explicit). This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key action ('Get the URL') and includes essential context (resource and input). There is zero waste, and every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and input, but lacks behavioral details (e.g., error cases) and output specifics (though no output schema exists, it could hint at the URL format). This meets minimum viability with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'olid' fully documented in the schema (including type and example). The description adds minimal value beyond the schema by mentioning the OLID in context, but does not provide additional syntax or format details. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get the URL') and resource ('an author's photo'), using the exact verb 'Get'. It distinguishes this tool from siblings like 'get_author_info' (which likely returns metadata) and 'get_book_cover' (which targets books), making the purpose unambiguous and sibling-differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying the required input ('using their Open Library Author ID'), which suggests when to use this tool (when you have an OLID). However, it does not explicitly state when not to use it or name alternatives (e.g., vs. 'get_author_info' for non-photo data), leaving some guidance gaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

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/8enSmith/mcp-open-library'

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