Skip to main content
Glama
2b3pro

propublica-npo-mcp

by 2b3pro

search_nonprofits

Search the ProPublica Nonprofit Explorer database for US nonprofits by name or keyword, with filters for state, NTEE category, and 501(c) subtype.

Instructions

Search US nonprofits in the ProPublica Nonprofit Explorer database by name or keyword, with optional filters for state, NTEE major category, and 501(c) subtype.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesName or keyword to search for.
stateNoOptional 2-letter US state code, for example "CA".
ntee_categoryNoOptional NTEE major category from 1-10. 1=Arts, 2=Education, 3=Environment, 4=Health, 5=Human Services, 6=International, 7=Public Benefit, 8=Religion, 9=Membership Benefit, 10=Unknown.
c_codeNoOptional 501(c) subtype code, for example 3 or 4.
pageNoOptional zero-based page number. ProPublica returns 100 results per page.

Implementation Reference

  • The handler function for the search_nonprofits tool. Calls client.search(args) and maps results using curateOrganization, returning JSON or error results.
    export async function handler(
      client: ProPublicaClient,
      args: z.infer<z.ZodObject<typeof inputSchema>>,
    ) {
      try {
        const result = await client.search(args);
        return jsonResult({
          total_results: result.total_results,
          num_pages: result.num_pages,
          current_page: result.cur_page,
          organizations: result.organizations.map((org) => curateOrganization(org)),
        });
      } catch (error) {
        return errorResult(error);
      }
    }
  • Exported constant defining the tool name as 'search_nonprofits'.
    export const name = "search_nonprofits";
  • Exported description for the search_nonprofits tool.
    export const description =
      "Search US nonprofits in the ProPublica Nonprofit Explorer database by name or keyword, with optional filters for state, NTEE major category, and 501(c) subtype.";
  • Zod input schema for the tool: query (required string), and optional state, ntee_category, c_code, and page.
    export const inputSchema = {
      query: z.string().min(1).describe("Name or keyword to search for."),
      state: z
        .string()
        .length(2)
        .optional()
        .describe('Optional 2-letter US state code, for example "CA".'),
      ntee_category: z
        .number()
        .int()
        .min(1)
        .max(10)
        .optional()
        .describe(
          "Optional NTEE major category from 1-10. 1=Arts, 2=Education, 3=Environment, 4=Health, 5=Human Services, 6=International, 7=Public Benefit, 8=Religion, 9=Membership Benefit, 10=Unknown.",
        ),
      c_code: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("Optional 501(c) subtype code, for example 3 or 4."),
      page: z
        .number()
        .int()
        .min(0)
        .optional()
        .describe("Optional zero-based page number. ProPublica returns 100 results per page."),
    };
  • Helper function curateOrganization that extracts a subset of fields from SearchOrganizationHit for the response.
    function curateOrganization(org: SearchOrganizationHit) {
      return {
        ein: String(org.ein).replace(/\D/g, ""),
        name: org.name,
        city: org.city ?? null,
        state: org.state ?? null,
        ntee_code: org.ntee_code ?? null,
        subseccd: org.subseccd ?? null,
        score: org.score ?? null,
      };
    }
  • src/index.ts:26-33 (registration)
    Registration of the search_nonprofits tool with the MCP server, linking name, description, inputSchema, and handler.
    server.registerTool(
      searchNonprofits.name,
      {
        description: searchNonprofits.description,
        inputSchema: searchNonprofits.inputSchema,
      },
      (args) => searchNonprofits.handler(client, args),
    );
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits such as rate limits, authentication requirements, data freshness, or behavior when no results are found. The burden is fully on the description, which falls short.

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?

Single sentence, front-loaded with action and target, no fluff. Efficiently conveys core purpose and optional filters.

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?

Moderate complexity with 5 parameters, no output schema. Description covers purpose and filters but omits return format, pagination details, and error handling. Adequate but not complete.

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 baseline is 3. The description mentions filters but adds little meaning beyond the schema: it names the database (ProPublica Nonprofit Explorer) but does not clarify parameter formats or constraints not already in the schema.

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

Purpose5/5

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

The description clearly states the tool searches US nonprofits by name/keyword in a specific database (ProPublica Nonprofit Explorer) and lists optional filters. It distinguishes from sibling tools which are compare, get, and list operations.

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?

No guidance on when to use this tool vs siblings or alternatives. The description does not mention exclusions or appropriate contexts beyond the basic search operation.

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/2b3pro/propublica-npo-mcp'

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