Skip to main content
Glama
6

MCP Server RubyGems

by 6

get_gem_reverse_dependencies

Identify RubyGems that depend on a specific gem by querying reverse dependencies, using the MCP Server RubyGems API for accurate dependency insights.

Instructions

Get gems that depend on a specific RubyGem

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
$schemaNo
additionalPropertiesNo
propertiesNo
requiredNo
typeNo

Implementation Reference

  • Zod input schema defining the gem_name parameter for the tool.
    const GetGemReverseDependenciesInputSchema = z.object({
      gem_name: z
        .string()
        .min(1)
        .describe('Name of the RubyGem to fetch reverse dependencies for'),
    });
  • Core handler function that fetches and parses reverse dependencies from the RubyGems API.
    async function getGemReverseDependencies(gemName: string): Promise<string[]> {
      const response = await fetch(
        `https://rubygems.org/api/v1/gems/${gemName}/reverse_dependencies.json`
      );
    
      if (!response.ok) {
        if (response.status === 404) {
          throw new Error(`RubyGem '${gemName}' not found`);
        }
        throw new Error(
          `Failed to fetch reverse dependencies: ${response.statusText}`
        );
      }
    
      const data = await response.json();
      return z.array(z.string()).parse(data);
    }
  • Exports the McpTool object, registering the tool with its name, description, input schema, and wrapper handler.
    export const getGemReverseDependenciesTool: McpTool = {
      name: 'get_gem_reverse_dependencies',
      description: 'Get gems that depend on a specific RubyGem',
      inputSchema: {
        type: 'object',
        properties: zodToJsonSchema(GetGemReverseDependenciesInputSchema),
      },
      handler: async (args: Record<string, unknown> | undefined) => {
        const { gem_name } = GetGemReverseDependenciesInputSchema.parse(args || {});
    
        try {
          const reverseDependencies = await getGemReverseDependencies(gem_name);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(reverseDependencies, null, 2),
              },
            ],
          };
        } catch (error: unknown) {
          return createErrorResponse(
            error,
            'Failed to fetch gem reverse dependencies'
          );
        }
      },
    };
  • src/index.ts:20-27 (registration)
    Includes the getGemReverseDependenciesTool in the list of available tools served by the MCP server.
    const tools: readonly McpTool[] = [
      getRubyGemInfoTool,
      searchRubyGemsTool,
      getGemVersionsTool,
      getGemReverseDependenciesTool,
      getOwnerGemsTool,
      getGemOwnersTool,
    ] as const;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool's function but doesn't add context like whether it's read-only, paginated, rate-limited, or what the output format is. For a tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the complexity (5 parameters with 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain the return values, parameter details, or behavioral traits, making it inadequate for the agent to fully understand and use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'a specific RubyGem' but doesn't clarify the parameter 'gem_name' or address other parameters. With a parameter count of 5 and 0% schema description coverage, the description fails to compensate for the undocumented parameters, leaving semantics unclear.

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 action ('Get gems') and the resource ('that depend on a specific RubyGem'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_rubygem_info' or 'search_rubygems' in terms of reverse dependency focus, which prevents a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context such as when reverse dependencies are needed compared to general gem info or searches, and it doesn't mention prerequisites or exclusions, leaving the agent without usage direction.

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

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

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