Skip to main content
Glama
damonxue

OSSInsight MCP Server

get_collection

Retrieve detailed information about a specific collection of GitHub repositories to analyze open source ecosystems and gain insights into related projects.

Instructions

Get information about a specific collection of repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesCollection ID, e.g., 'open-source-database'

Implementation Reference

  • The core handler function implementing the 'get_collection' tool logic. It fetches collection data from the OSSInsight API and falls back to web scraping if the API fails.
    async function getCollection(collectionId: string): Promise<any> {
      try {
        // Get collection data from API if available
        const collectionData = await apiRequest(`/collections/${collectionId}`);
        
        // Get web page URL for reference
        const webUrl = `${OSSINSIGHT_WEB_URL}/collections/${collectionId}`;
        
        // Try to get additional data from the web page
        const webData = await scrapeOSSInsightPage(webUrl, {
          title: 'h1',
          description: '.collection-description',
          // Add more selectors as needed
        });
        
        return {
          collection_data: collectionData,
          web_data: webData,
          web_url: webUrl
        };
      } catch (error) {
        // If API fails, rely on web page data
        console.error(`API request failed, falling back to web scraping: ${error}`);
        const webUrl = `${OSSINSIGHT_WEB_URL}/collections/${collectionId}`;
        
        return {
          web_data: await scrapeOSSInsightPage(webUrl, {
            title: 'h1',
            description: '.collection-description',
            repos_count: '.repos-count',
            // Add more selectors as needed
          }),
          web_url: webUrl
        };
      }
    }
  • Zod schema defining the input parameters for the 'get_collection' tool, specifically the collection_id.
    export const GetCollectionParamsSchema = z.object({
      collection_id: z.string().describe("Collection ID, e.g., 'open-source-database'")
    });
  • index.ts:297-301 (registration)
    Tool registration in the list of available tools returned by ListToolsRequestSchema handler.
    {
      name: "get_collection",
      description: "Get information about a specific collection of repositories",
      inputSchema: zodToJsonSchema(GetCollectionParamsSchema)
    },
  • index.ts:336-340 (registration)
    Dispatch case in the CallToolRequestSchema handler that invokes the getCollection function.
    case "get_collection": {
      const args = GetCollectionParamsSchema.parse(request.params.arguments);
      const collection = await getCollection(args.collection_id);
      return { content: [{ type: "text", text: JSON.stringify(collection, null, 2) }] };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get information'), which is helpful, but doesn't describe what information is returned (e.g., metadata, repository list, permissions), error conditions, or any rate limits or authentication requirements.

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?

The description is a single, clear sentence with no wasted words. It's appropriately sized for a simple lookup tool and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what information is returned about the collection (e.g., name, description, repositories, permissions), which is critical for an agent to understand the tool's utility. The lack of behavioral context and output details leaves significant gaps.

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%, with the single parameter 'collection_id' documented in the schema. The description doesn't add any additional meaning about the parameter beyond what the schema provides (e.g., examples of valid IDs beyond 'open-source-database', format constraints). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get information about') and resource ('a specific collection of repositories'), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'list_collections', which presumably lists multiple collections rather than retrieving details about a specific one.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling 'list_collections' for browsing collections or 'get_repo_analysis' for repository-level details, nor does it specify prerequisites like needing a collection ID first.

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

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