Skip to main content
Glama
botanicastudios

Crossref MCP Server

searchByAuthor

Find scientific papers by author name using Crossref's database, returning structured metadata for academic research.

Instructions

Search for scientific papers by author in Crossref

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorYesThe author name to search for
rowsNoNumber of results to return

Implementation Reference

  • The primary handler function that executes the searchByAuthor tool logic: queries Crossref API with author name, fetches works, formats them using formatWorkToJson, and returns JSON-structured content.
      async ({ author, rows }) => {
        try {
          const url = `${CROSSREF_API_BASE}/works?query.author=${encodeURIComponent(
            author
          )}&rows=${rows}&select=${CROSSREF_SELECT_FIELDS}`;
          const response = await fetch(url, {
            headers: {
              "User-Agent": "Crossref MCP Server",
            },
          });
    
          if (!response.ok) {
            throw new Error(`API request failed with status ${response.status}`);
          }
    
          const data = await response.json();
          const works = data.message?.items || [];
    
          if (works.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(
                    {
                      status: "no_results",
                      query: { author, rows },
                      results: [],
                    },
                    null,
                    2
                  ),
                },
              ],
            };
          }
    
          const formattedWorks = works.map((work) => formatWorkToJson(work));
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    status: "success",
                    query: { author, rows },
                    count: formattedWorks.length,
                    results: formattedWorks,
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    status: "error",
                    message: error.message,
                    query: { author, rows },
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
      }
    );
  • Zod input schema defining parameters for the searchByAuthor tool: required 'author' string and optional 'rows' number (default 5).
    {
      author: z.string().describe("The author name to search for"),
      rows: z
        .number()
        .optional()
        .default(5)
        .describe("Number of results to return"),
    },
  • mcp-server.js:110-197 (registration)
    Registration of the 'searchByAuthor' tool via McpServer.tool() method, specifying name, description, input schema, and handler function.
    server.tool(
      "searchByAuthor",
      "Search for scientific papers by author in Crossref",
      {
        author: z.string().describe("The author name to search for"),
        rows: z
          .number()
          .optional()
          .default(5)
          .describe("Number of results to return"),
      },
      async ({ author, rows }) => {
        try {
          const url = `${CROSSREF_API_BASE}/works?query.author=${encodeURIComponent(
            author
          )}&rows=${rows}&select=${CROSSREF_SELECT_FIELDS}`;
          const response = await fetch(url, {
            headers: {
              "User-Agent": "Crossref MCP Server",
            },
          });
    
          if (!response.ok) {
            throw new Error(`API request failed with status ${response.status}`);
          }
    
          const data = await response.json();
          const works = data.message?.items || [];
    
          if (works.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(
                    {
                      status: "no_results",
                      query: { author, rows },
                      results: [],
                    },
                    null,
                    2
                  ),
                },
              ],
            };
          }
    
          const formattedWorks = works.map((work) => formatWorkToJson(work));
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    status: "success",
                    query: { author, rows },
                    count: formattedWorks.length,
                    results: formattedWorks,
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    status: "error",
                    message: error.message,
                    query: { author, rows },
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
      }
    );
  • Test handler for searchByAuthor, identical logic for use in testing contexts.
    searchByAuthor: async ({ author, rows = 5 }) => {
      try {
        const url = `https://api.crossref.org/works?query.author=${encodeURIComponent(
          author
        )}&rows=${rows}`;
        const response = await fetch(url, {
          headers: {
            "User-Agent": "Crossref MCP Server Test",
          },
        });
    
        if (!response.ok) {
          throw new Error(`API request failed with status ${response.status}`);
        }
    
        const data = await response.json();
        const works = data.message?.items || [];
    
        if (works.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    status: "no_results",
                    query: { author, rows },
                    results: [],
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
    
        const formattedWorks = works.map((work) => formatWorkToJson(work));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  status: "success",
                  query: { author, rows },
                  count: formattedWorks.length,
                  results: formattedWorks,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  status: "error",
                  message: error.message,
                  query: { author, rows },
                },
                null,
                2
              ),
            },
          ],
        };
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool searches but doesn't mention whether it's read-only, what happens on errors, rate limits, authentication needs, or response format. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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 with zero waste. It's appropriately sized and front-loaded with the core purpose, 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 no annotations, no output schema, and a search tool that likely returns complex results, the description is incomplete. It doesn't explain what the search returns, how results are structured, or any behavioral constraints. For a tool with this complexity and lack of structured data, 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?

Schema description coverage is 100%, so the schema already documents both parameters ('author' and 'rows') with descriptions. The description doesn't add any parameter details beyond what's in the schema, such as search syntax or result ordering. Baseline 3 is appropriate when schema does the heavy lifting.

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 scientific papers') and resource ('by author in Crossref'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'searchByTitle' or 'getWorkByDOI' beyond the 'by author' qualifier, which is why it doesn't reach a perfect score.

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 'searchByTitle' or 'getWorkByDOI'. There's no mention of use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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/botanicastudios/crossref-mcp'

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