Skip to main content
Glama

natural_language_query

Analyze GitHub data instantly by submitting natural language queries to extract insights on repositories, developers, and open source ecosystems.

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 core handler function for the 'natural_language_query' tool. It takes a natural language query string and returns a structured response with a message and a direct link to the OSSInsight web chat interface for executing the query.
    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: requires a 'query' field as a string with a descriptive example.
    export const NaturalLanguageQueryParamsSchema = z.object({ query: z.string().describe("Natural language query, e.g., 'Which repositories gained the most stars in 2023?'") });
  • index.ts:307-311 (registration)
    Registration of the tool in the ListToolsRequest handler response, specifying name, description, and input schema converted to JSON schema format.
    { name: "natural_language_query", description: "Query GitHub data using natural language through the OSSInsight chat interface", inputSchema: zodToJsonSchema(NaturalLanguageQueryParamsSchema) }
  • index.ts:348-352 (registration)
    Dispatch handler in the CallToolRequest switch statement: parses input arguments using the schema, calls the naturalLanguageQuery handler, and formats the response as MCP content.
    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) }] }; }

Other Tools

Related 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/damonxue/mcp-ossinsight'

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