get_firearm
Retrieve comprehensive firearm details including specifications, descriptions, and images by providing a specific firearm ID.
Instructions
Get detailed information about a specific firearm by its ID. Returns comprehensive details including specifications, description, and images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the firearm to retrieve |
Implementation Reference
- src/tools/get-firearm.ts:67-80 (handler)The handler function that executes the `get_firearm` tool logic by calling the API client and formatting the response.
export async function getFirearm( client: GunsnationApiClient, input: GetFirearmInput ): Promise<string> { const response = await client.getFirearm({ id: input.id, }); if (!response.success) { return `Error: ${response.error.message} (${response.error.code})`; } return formatDetailedFirearm(response.data); } - src/tools/get-firearm.ts:5-7 (schema)Zod schema for validating the input arguments for the `get_firearm` tool.
export const getFirearmSchema = z.object({ id: z.union([z.string(), z.number()]).describe('The ID of the firearm to retrieve'), }); - src/server.ts:109-111 (registration)Registration and invocation logic within the server's request handler switch statement.
case 'get_firearm': { const input = getFirearmSchema.parse(args); const result = await getFirearm(this.apiClient, input);