Skip to main content
Glama

query_kg_edges

Explore relationships in a knowledge graph by filtering edges based on entity names or relationship types. Retrieve connections between deals, investors, startups, and scoring data with detailed metadata.

Instructions

Traverse Knowledge Graph edges by entity name and/or relationship type. Returns edges with source/target node IDs, relations, scores, and metadata. Use this to explore deal relationships, investor-startup connections, and scoring edges. Gracefully returns empty results if the Knowledge Graph is not configured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNameNoFilter edges by entity name
relationshipTypeNoFilter edges by relationship type (e.g., "INVESTED_IN", "SCORED")
limitNoMax edges to return (default 100, max 500)

Implementation Reference

  • The MCP tool registration and handler implementation for 'query_kg_edges'. It defines the input schema using Zod and invokes the 'queryKgEdges' method on the client object.
        server.tool(
            'query_kg_edges',
            `Traverse Knowledge Graph edges by entity name and/or relationship type.
    Returns edges with source/target node IDs, relations, scores, and metadata.
    Use this to explore deal relationships, investor-startup connections, and scoring edges.
    Gracefully returns empty results if the Knowledge Graph is not configured.`,
            {
                entityName: z.string().optional().describe('Filter edges by entity name'),
                relationshipType: z.string().optional().describe('Filter edges by relationship type (e.g., "INVESTED_IN", "SCORED")'),
                limit: z.number().min(1).max(500).optional().describe('Max edges to return (default 100, max 500)'),
            },
            async ({ entityName, relationshipType, limit }, extra) => {
                const client = clientFactory(extra);
                const result = await client.queryKgEdges(entityName, relationshipType, limit);
                return {
                    content: [{
                        type: 'text' as const,
                        text: JSON.stringify(result, null, 2),
                    }],
                };
            }
        );

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/Agentled/mcp-server'

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