Skip to main content
Glama

search-by-medium

Search the Art Institute of Chicago collection by medium to find artworks matching specific materials like oil on canvas or watercolor on paper.

Instructions

Search for artworks by medium in the Art Institute of Chicago. Pagination is supported with the page parameter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mediumYesThe medium to search for (e.g., "oil on canvas", "acrylic on panel", "watercolor on paper").
limitNoThe number of resources to return per page.
pageNoThe page of results to return. Used for pagination.

Implementation Reference

  • Core execution logic: builds Elasticsearch query for medium search, performs POST to /artworks/search API, attaches pagination, and formats results using BaseTool's formatArtworkList.
    public async executeCore(input: z.infer<typeof this.inputSchema>) { const { medium, limit, page } = input; const query = { query: { bool: { should: [ { match_phrase: { medium_display: `${medium}` } }, { match: { medium_display: medium } }, ], minimum_should_match: 1, }, }, }; const url = new URL(`${this.apiBaseUrl}/artworks/search`); url.searchParams.set('page', `${page}`); url.searchParams.set('limit', `${limit}`); 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: any) => { artwork._pagination = parsedData.pagination; }); return this.formatArtworkList(parsedData.data, medium); }
  • Zod input schema defining required 'medium' string and optional 'limit'/'page' numbers with descriptions.
    const mediumSearchSchema = z.object({ medium: z .string() .describe( 'The medium to search for (e.g., "oil on canvas", "acrylic on panel", "watercolor on paper").', ), 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.'), });
  • src/index.ts:87-92 (registration)
    Registers the tool with MCP server via server.tool(), binding name, description, input schema shape, and execute method.
    this.server.tool( this.searchByMediumTool.name, this.searchByMediumTool.description, this.searchByMediumTool.inputSchema.shape, this.searchByMediumTool.execute.bind(this.searchByMediumTool), );

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