Skip to main content
Glama

get_release_asset

Retrieve a specific asset from a GitHub release by providing the repository owner, repo name, and asset ID. Streamlines access to release artifacts for automation or integration workflows.

Instructions

Get a release asset from a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_idYesThe ID of the asset
ownerYesRepository owner (username or organization)
repoYesRepository name

Implementation Reference

  • The core handler function that makes the GitHub API request to retrieve the release asset details and validates the response using Zod.
    export async function getReleaseAsset( github_pat: string, owner: string, repo: string, asset_id: number ): Promise<z.infer<typeof ReleaseAssetSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/releases/assets/${asset_id}` ); return ReleaseAssetSchema.parse(response); }
  • Input schema definition for the get_release_asset tool parameters (owner, repo, asset_id).
    export const GetReleaseAssetSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), asset_id: z.number().describe("The ID of the asset") });
  • Extended input schema including the GitHub PAT, used for parsing arguments in the handler.
    export const _GetReleaseAssetSchema = GetReleaseAssetSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • src/index.ts:180-183 (registration)
    Tool registration in the listTools response, defining name, description, and input schema.
    name: "get_release_asset", description: "Get a release asset from a GitHub repository", inputSchema: zodToJsonSchema(releases.GetReleaseAssetSchema), },
  • src/index.ts:559-565 (registration)
    Dispatch handler in the callTool switch statement that parses arguments and invokes the getReleaseAsset function.
    case "get_release_asset": { const args = releases._GetReleaseAssetSchema.parse(params.arguments); const result = await releases.getReleaseAsset(args.github_pat, args.owner, args.repo, args.asset_id); 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/MissionSquad/mcp-github'

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