Skip to main content
Glama

search_entities

Search for corporate and organizational entities by name to track relationships and influence. Filter results by region or tags to identify key players in corporate networks.

Instructions

Search for entities by name. Results are ranked by number of relationships.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesSearch query (entity name)
pageNoPage number for pagination (default: 1)
regionsNoFilter by region ID
tagsNoFilter by tags (e.g., "oil")

Implementation Reference

  • The main handler function for the 'search_entities' tool. It calls LittleSisApi.searchEntities with the input args, formats the result as text content, and handles errors appropriately.
    export async function handleSearchEntities(args: any) { try { const result = await LittleSisApi.searchEntities(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error searching entities: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • The Tool schema definition for 'search_entities', including inputSchema with properties q (required), page, regions, tags.
    export const searchEntitesTool: Tool = { name: 'search_entities', description: 'Search for entities by name. Results are ranked by number of relationships.', inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Search query (entity name)' }, page: { type: 'number', description: 'Page number for pagination (default: 1)', minimum: 1 }, regions: { type: 'number', description: 'Filter by region ID' }, tags: { type: 'string', description: 'Filter by tags (e.g., "oil")' } }, required: ['q'] } };
  • src/index.ts:72-81 (registration)
    Registration of the tool handler in the central toolHandlers mapping used by the CallToolRequestSchema handler to dispatch tool calls.
    const toolHandlers = { get_entity: handleGetEntity, get_entities: handleGetEntities, search_entities: handleSearchEntities, get_entity_extensions: handleGetEntityExtensions, get_entity_relationships: handleGetEntityRelationships, get_entity_connections: handleGetEntityConnections, get_entity_lists: handleGetEntityLists, get_relationship: handleGetRelationship, };
  • The LittleSisApi helper method searchEntities that constructs the API request to LittleSis /entities/search endpoint and is called by the tool handler.
    static async searchEntities(params: EntitySearchParams): Promise<LittleSisApiResponse<Entity[]>> { const searchParams = new URLSearchParams(); searchParams.append('q', params.q); if (params.page) searchParams.append('page', params.page.toString()); if (params.regions) searchParams.append('regions', params.regions.toString()); if (params.tags) searchParams.append('tags', params.tags); return makeApiRequest<Entity[]>(`/entities/search?${searchParams.toString()}`); }

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/code-rabi/littlesis-mcp'

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