Skip to main content
Glama

natural_language_query

Query GitHub data using natural language to analyze repositories, developers, and organizations for open source insights.

Instructions

Query GitHub data using natural language through the OSSInsight chat interface

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query, e.g., 'Which repositories gained the most stars in 2023?'

Implementation Reference

  • The main execution logic for the 'natural_language_query' tool. It constructs a URL to the OSSInsight web chat interface with the provided query and returns a message directing the user there, as direct API support for natural language queries is not available.
    async function naturalLanguageQuery(query: string): Promise<any> { // Natural language query is likely not available via the public API // So we'll direct users to the web interface const webUrl = `${OSSINSIGHT_WEB_URL}/chat?question=${encodeURIComponent(query)}`; return { message: "Natural language queries are best handled through the OSSInsight web interface.", web_url: webUrl }; }
  • Zod schema defining the input parameters for the natural_language_query tool: a required 'query' string.
    export const NaturalLanguageQueryParamsSchema = z.object({ query: z.string().describe("Natural language query, e.g., 'Which repositories gained the most stars in 2023?'") });
  • index.ts:308-311 (registration)
    Tool registration in the ListToolsRequestHandler response, specifying name, description, and input schema converted to JSON schema.
    name: "natural_language_query", description: "Query GitHub data using natural language through the OSSInsight chat interface", inputSchema: zodToJsonSchema(NaturalLanguageQueryParamsSchema) }
  • Dispatch handler in CallToolRequestHandler that validates input with the schema, calls the naturalLanguageQuery function, and formats the response.
    case "natural_language_query": { const args = NaturalLanguageQueryParamsSchema.parse(request.params.arguments); const result = await naturalLanguageQuery(args.query); return { content: [{ type: "text", 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/damonxue/mcp-ossinsight'

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