Skip to main content
Glama

get-artwork-by-artist

Retrieve artworks from the Art Institute of Chicago collection by specifying an artist ID. Supports pagination to browse results systematically.

Instructions

Get artworks by artist id in the Art Institute of Chicago collection. Pagination is supported with the page parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe id of the artist to search for artworks. Should be the Artist ID of the `search-for-artist` tool.
limitNoThe number of resources to return per page.
pageNoThe page of results to return. Used for pagination.

Implementation Reference

  • The GetArtworkByArtistTool class implements the core execution logic for the 'get-artwork-by-artist' tool, handling input parsing, API request construction to the Art Institute of Chicago search endpoint, response validation, and formatting.
    export class GetArtworkByArtistTool extends BaseTool<typeof artworkByArtistSchema, any> {
      public readonly name: string = 'get-artwork-by-artist';
      public readonly description: string = 'Get artworks by artist id in the Art Institute of Chicago collection. Pagination is supported with the page parameter.';
      public readonly inputSchema = artworkByArtistSchema;
    
      constructor() {
        super();
      }
    
      public async executeCore(input: z.infer<typeof this.inputSchema>) {
        const { id, limit, page } = input;
    
        const query = {
          query: {
            term: {
              artist_id: id,
            },
          },
        };
    
        const url = new URL(`${this.apiBaseUrl}/artworks/search`);
        url.searchParams.set('page', `${page}`);
        url.searchParams.set('limit', `${limit}`);
        url.searchParams.set('query', `artist_id:${id}`);
    
        const parsedData = await this.safeApiRequest(
          url,
          {
            method: 'POST',
            body: JSON.stringify(query),
          },
          artworkSearchResponseSchema,
        );
        // Attach pagination info to each artwork for formatting
        parsedData.data.forEach((artwork) => {
          (artwork as any)._pagination = parsedData.pagination;
        });
        return this.formatArtworkList(parsedData.data, `Artworks by artist ID ${id}`);
      }
    }
  • Input schema (Zod) defining parameters for the tool: artist ID (required), optional limit and page for pagination.
    const artworkByArtistSchema = z.object({
      id: z.number().describe('The id of the artist to search for artworks. Should be the Artist ID of the `search-for-artist` tool.'),
      limit: z.number().optional().default(10).describe('The number of resources to return per page.'),
      page: z.number().optional().default(1).describe('The page of results to return. Used for pagination.'),
    });
  • Output schema (Zod) for validating the artwork search API response, used in the tool's safeApiRequest method.
    export const artworkSearchResponseSchema = z.object({
      preference: z.string().nullable(),
      pagination: paginationSchema,
      data: z.array(z.object({
        _score: z.number(),
        id: z.number(),
        api_model: z.string(),
        api_link: z.string(),
        is_boosted: z.boolean(),
        title: z.string(),
        thumbnail: thumbnailSchema.nullable(),
        timestamp: z.string(),
      })),
      info: apiInfoSchema,
      config: apiConfigSchema,
    });
  • src/index.ts:81-86 (registration)
    Registers the 'get-artwork-by-artist' tool with the MCP server by calling server.tool() with the tool's name, description, input schema, and execute method.
    this.server.tool(
      this.getArtworkByArtistTool.name,
      this.getArtworkByArtistTool.description,
      this.getArtworkByArtistTool.inputSchema.shape,
      this.getArtworkByArtistTool.execute.bind(this.getArtworkByArtistTool),
    );
  • formatArtworkList helper method used by the tool to format the list of artworks into a readable text response with pagination info.
    protected formatArtworkList(artworks: any[], query: string) {
      if (artworks.length === 0) {
        return {
          content: [{ type: 'text' as const, text: `No artworks found for "${query}".` }],
          isError: false,
        };
      }
    
      const artText = artworks.map((artwork) => {
        return `Title: ${artwork.title}\n`
          + `Artwork ID: ${artwork.id}\n`
          + `Thumbnail alt text: ${artwork.thumbnail?.alt_text ?? 'No thumbnail available'}\n`
          + `Score: ${artwork._score}\n`;
      }).join('\n-----\n');
    
      const paginationText = artworks.length > 0
        ? `\nPagination Info\n`
        + `Total: ${artworks[0]._pagination?.total || 'Unknown'}\n`
        + `Total Pages: ${artworks[0]._pagination?.total_pages || 'Unknown'}\n`
        + `Current Page: ${artworks[0]._pagination?.current_page || 'Unknown'}`
        : '';
    
      return {
        content: [{ type: 'text' as const, text: artText + paginationText }],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination support, which is useful context, but doesn't describe other important behaviors like whether this is a read-only operation (implied by 'Get'), error handling, rate limits, authentication needs, or what the response format looks like. For a tool with no annotation coverage, this leaves significant gaps.

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

Conciseness4/5

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

The description is appropriately concise with two sentences. The first sentence states the core purpose, and the second adds important behavioral context about pagination. No wasted words, though it could be slightly more structured with clearer separation of purpose versus guidance.

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 moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and pagination behavior, but doesn't address response format, error cases, or differentiation from sibling tools. With no output schema, the description should ideally provide more information about what gets returned.

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%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema: it mentions pagination with the page parameter (already in schema) and implies the artist id comes from 'search-for-artist' (hinted in schema description). No additional syntax, format, or usage details are provided beyond what's in the structured fields.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get artworks by artist id in the Art Institute of Chicago collection.' It specifies the verb ('Get'), resource ('artworks'), and scope ('Art Institute of Chicago collection'), but doesn't explicitly differentiate it from sibling tools like 'get-artwork-by-id' or 'search-for-artist' beyond the artist focus.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance. It mentions pagination support with the page parameter, but doesn't specify when to use this tool versus alternatives like 'search-for-artist' or 'full-text-search'. No exclusions, prerequisites, or context for tool selection are provided.

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

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/mikechao/artic-mcp'

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