get_gem_owners
Retrieve ownership details for a specific RubyGem using the RubyGems.org API. Input the gem name to fetch its owners, aiding in package management and collaboration.
Instructions
Get the owners of a specific RubyGem
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| $schema | No | ||
| additionalProperties | No | ||
| properties | No | ||
| required | No | ||
| type | No |
Implementation Reference
- src/tools/get_gem_owners.ts:24-38 (handler)Core handler function that fetches the owners of a RubyGem from the RubyGems API and validates the response.async function getGemOwners(gemName: string): Promise<GemOwner[]> { const response = await fetch( `https://rubygems.org/api/v1/gems/${gemName}/owners.json` ); if (!response.ok) { if (response.status === 404) { throw new Error(`RubyGem '${gemName}' not found`); } throw new Error(`Failed to fetch gem owners: ${response.statusText}`); } const data = await response.json(); return z.array(GemOwnerSchema).parse(data); }
- src/tools/get_gem_owners.ts:16-21 (schema)Input schema defining the gem_name parameter for the get_gem_owners tool.const GetGemOwnersInputSchema = z.object({ gem_name: z .string() .min(1) .describe('Name of the RubyGem to fetch owners for'), });
- src/tools/get_gem_owners.ts:7-11 (schema)Schema for individual gem owner objects used in the response validation.const GemOwnerSchema = z.object({ id: z.number(), handle: z.string(), email: z.string().optional(), });
- src/tools/get_gem_owners.ts:41-65 (registration)MCP tool registration including name, description, input schema conversion, and wrapper handler that parses input, calls the core handler, formats response, and handles errors.export const getGemOwnersTool: McpTool = { name: 'get_gem_owners', description: 'Get the owners of a specific RubyGem', inputSchema: { type: 'object', properties: zodToJsonSchema(GetGemOwnersInputSchema), }, handler: async (args: Record<string, unknown> | undefined) => { const { gem_name } = GetGemOwnersInputSchema.parse(args || {}); try { const owners = await getGemOwners(gem_name); return { content: [ { type: 'text', text: JSON.stringify(owners, null, 2), }, ], }; } catch (error: unknown) { return createErrorResponse(error, 'Failed to fetch gem owners'); } }, };
- src/index.ts:20-27 (registration)Registration of all tools including getGemOwnersTool in the server's tools array.const tools: readonly McpTool[] = [ getRubyGemInfoTool, searchRubyGemsTool, getGemVersionsTool, getGemReverseDependenciesTool, getOwnerGemsTool, getGemOwnersTool, ] as const;