Skip to main content
Glama

search-for-artist

Find artists in the Art Institute of Chicago collection by searching their names, with pagination support for browsing results.

Instructions

Search for artists in the Art Institute of Chicago collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the artist to search for.
limitNoThe number of resources to return per page.
pageNoThe page of results to return. Used for pagination.

Implementation Reference

  • Implements the core tool logic: builds query for artist search via API, handles response, formats output with artist details and pagination.
    public async executeCore(input: z.infer<typeof this.inputSchema>) {
      const { name, limit, page } = input;
    
      const query = {
        query: {
          bool: {
            should: [
              { match_phrase: { title: `"${name}"` } },
            ],
            minimum_should_match: 1,
          },
        },
      };
    
      const url = new URL(`${this.apiBaseUrl}/agents/search`);
      url.searchParams.set('page', `${page}`);
      url.searchParams.set('limit', `${limit}`);
    
      const parsedData = await this.safeApiRequest(
        url,
        {
          method: 'POST',
          body: JSON.stringify(query),
        },
        artistSearchResponseSchema,
      );
      if (parsedData.data.length === 0) {
        return {
          content: [{
            type: 'text' as const,
            text: `No results found for "${name}".`,
          }],
        };
      }
      const text = parsedData.data.map((artist) => {
        return `Title: ${artist.title}\n`
          + `Artist ID: ${artist.id}\n`
          + `Score: ${artist._score}\n`;
      }).join('\n-----\n');
      const paginationText = `\nPagination Info\n`
        + `Total: ${parsedData.pagination.total}\n`
        + `Total Pages: ${parsedData.pagination.total_pages}\n`
        + `Current Page: ${parsedData.pagination.current_page}\n`;
    
      return {
        content: [{ type: 'text' as const, text: text + paginationText }],
      };
    }
  • src/index.ts:75-80 (registration)
    Registers the 'search-for-artist' tool with the MCP server, providing name, description, input schema, and bound execute method.
    this.server.tool(
      this.artistSearchTool.name,
      this.artistSearchTool.description,
      this.artistSearchTool.inputSchema.shape,
      this.artistSearchTool.execute.bind(this.artistSearchTool),
    );
  • Zod input schema defining parameters: name (required string), optional limit and page.
    const artistSearchSchema = z.object({
      name: z.string().describe('The name of the artist to search for.'),
      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.'),
    });
  • Zod schema for validating the API response from artist search endpoint (/agents/search).
    export const artistSearchResponseSchema = 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(),
        title: z.string(),
        timestamp: z.string(),
      })),
      info: apiInfoSchema,
      config: apiConfigSchema,
    });
  • Class definition extending BaseTool, setting tool name, description, and input schema.
    export class ArtistSearchTool extends BaseTool<typeof artistSearchSchema, any> {
      public readonly name: string = 'search-for-artist';
      public readonly description: string = 'Search for artists in the Art Institute of Chicago collection';
      public readonly inputSchema = artistSearchSchema;
    
      constructor() {
        super();
      }
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 states the search function but doesn't mention whether it's read-only, if there are rate limits, authentication needs, or what the return format looks like (e.g., paginated results). This leaves significant gaps for a tool with three parameters and no output schema.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what the search returns (e.g., artist details, IDs), how results are structured, or any behavioral traits like pagination handling, which are critical for a search tool with three parameters.

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?

The schema description coverage is 100%, with clear descriptions for 'name', 'limit', and 'page' parameters. The description doesn't add any additional semantic context beyond what the schema provides, such as search behavior or result formatting, but the schema adequately covers the basics.

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 action ('Search for artists') and the resource domain ('Art Institute of Chicago collection'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'full-text-search' or 'search-by-title', which might also involve searching the same collection.

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 no guidance on when to use this tool versus alternatives like 'get-artwork-by-artist' or 'search-by-title'. It lacks any mention of prerequisites, exclusions, or comparative context with sibling tools, leaving the agent to infer usage scenarios.

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