Skip to main content
Glama
ukicar

Gallica/BnF MCP Server

by ukicar

search_by_author

Find documents in the Gallica digital library by searching for specific authors. Use exact or partial name matching to locate relevant materials from the Bibliothèque nationale de France collection.

Instructions

Search for documents in the Gallica digital library by author.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorYesThe author name to search for
exact_matchNoIf true, search for the exact author name; otherwise, search for author containing the words
max_resultsNoMaximum number of results to return (1-50)
start_recordNoStarting record for pagination

Implementation Reference

  • Main tool definition for search_by_author. Contains the input schema (lines 72-96) and handler function (lines 97-105) that parses arguments and calls the SearchAPI.searchByAuthor method.
    export function createSearchByAuthorTool(searchApi: SearchAPI) {
      return {
        name: 'search_by_author',
        description: 'Search for documents in the Gallica digital library by author.',
        inputSchema: {
          type: 'object',
          properties: {
            author: {
              type: 'string',
              description: 'The author name to search for',
            },
            exact_match: {
              type: 'boolean',
              description: 'If true, search for the exact author name; otherwise, search for author containing the words',
              default: false,
            },
            max_results: {
              type: 'number',
              description: 'Maximum number of results to return (1-50)',
              default: config.defaultMaxRecords,
            },
            start_record: {
              type: 'number',
              description: 'Starting record for pagination',
              default: config.defaultStartRecord,
            },
          },
          required: ['author'],
        },
        handler: async (args: unknown) => {
          const parsed = exactMatchSchema.extend({ author: z.string() }).parse(args);
          return await searchApi.searchByAuthor(
            parsed.author,
            parsed.exact_match ?? false,
            parsed.max_results ?? config.defaultMaxRecords,
            parsed.start_record ?? config.defaultStartRecord
          );
        },
      };
    }
  • API implementation of searchByAuthor method. Constructs CQL query using dc.creator field and calls the core search method. Handles both exact match and partial match modes.
    searchByAuthor(
      author: string,
      exactMatch: boolean = false,
      maxResults: number = config.defaultMaxRecords,
      startRecord: number = config.defaultStartRecord
    ): Promise<SearchResult> {
      const query = exactMatch ? `dc.creator all "${author}"` : `dc.creator all ${author}`;
      return this.search(query, startRecord, maxResults);
    }
  • src/mcpServer.ts:75-82 (registration)
    Tool registration in MCP server. Creates the searchByAuthor tool instance using createSearchByAuthorTool factory function and adds it to the tools array for registration.
    // Register search tools (7 tools matching Python)
    const searchByTitle = createSearchByTitleTool(searchApi);
    const searchByAuthor = createSearchByAuthorTool(searchApi);
    const searchBySubject = createSearchBySubjectTool(searchApi);
    const searchByDate = createSearchByDateTool(searchApi);
    const searchByDocumentType = createSearchByDocumentTypeTool(searchApi);
    const advancedSearch = createAdvancedSearchTool(searchApi);
    const naturalLanguageSearch = createNaturalLanguageSearchTool(searchApi);
  • Zod validation schema for exact match search parameters. Used to validate and parse input arguments for search_by_author tool handler.
    const exactMatchSchema = searchParamsSchema.extend({
      exact_match: z.boolean().optional(),
    });
  • Type definition for SearchResult returned by searchByAuthor. Contains metadata (query, total_records, records_returned, date_retrieved) and array of SearchRecord objects.
    export interface SearchResult {
      metadata: SearchMetadata;
      records: SearchRecord[];
      error?: string;
      parameters?: Record<string, unknown>;
    }
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 basic function but doesn't mention important behavioral aspects like rate limits, authentication requirements, pagination behavior (beyond what's implied by parameters), error conditions, or what format the results will be returned in. For a search tool with no annotation coverage, this is a significant gap.

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 states the core purpose without any unnecessary words. It's appropriately sized for a straightforward search tool and gets directly to the point with zero waste.

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 tool has no annotations, no output schema, and multiple sibling tools, the description is insufficiently complete. It doesn't explain what the search returns (document metadata? full text? URLs?), how results are ordered, or how this tool differs from other search options. For a search tool in a library with 11 sibling tools, more context is needed.

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?

With 100% schema description coverage, the input schema already documents all 4 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 documents') and target resource ('in the Gallica digital library by author'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'search_by_title', 'search_by_date', etc., which follow the same pattern but with different search criteria.

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 'natural_language_search' or 'advanced_search'. It mentions the search criteria ('by author') but doesn't explain when author-based searching is preferable or what limitations this approach might have compared to other search methods available.

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/ukicar/sweet-bnf'

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