Skip to main content
Glama
DynamicDeals

Gunsnation MCP

by DynamicDeals

search_firearms

Search the Gunsnation firearms database to find weapons by name, brand, model, or UPC. Filter results by category and get details like caliber, action type, and price.

Instructions

Search the Gunsnation firearms database. Returns a list of firearms matching the search criteria with basic details including name, brand, caliber, action type, and price.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query for firearm name, brand, model, or UPC
categoryNoCategory filter (e.g., "Handguns", "Rifles", "Shotguns")
limitNoMaximum number of results (1-100, default: 20)
offsetNoNumber of results to skip for pagination

Implementation Reference

  • The handler function that performs the API call to search firearms and formats the results for the MCP response.
    export async function searchFirearms(
      client: GunsnationApiClient,
      input: SearchFirearmsInput
    ): Promise<string> {
      const response = await client.searchFirearms({
        query: input.query,
        category: input.category,
        limit: input.limit,
        offset: input.offset,
      });
    
      if (!response.success) {
        return `Error: ${response.error.message} (${response.error.code})`;
      }
    
      if (response.data.length === 0) {
        return 'No firearms found matching your search criteria.';
      }
    
      const results: string[] = [];
      results.push(`Found ${response.meta.total} firearms (showing ${response.data.length}):\n`);
    
      for (const firearm of response.data) {
        results.push(formatFirearmForDisplay(firearm));
        results.push(''); // Empty line between results
      }
    
      if (response.meta.offset + response.data.length < response.meta.total) {
        results.push(`\n---\nShowing ${response.meta.offset + 1}-${response.meta.offset + response.data.length} of ${response.meta.total}. Use offset parameter to see more results.`);
      }
    
      return results.join('\n');
    }
  • Zod schema for validating the input arguments for the search_firearms tool.
    export const searchFirearmsSchema = z.object({
      query: z.string().optional().describe('Search query for firearm name, brand, model, or UPC'),
      category: z.string().optional().describe('Category filter (e.g., "Handguns", "Rifles", "Shotguns")'),
      limit: z.number().min(1).max(100).optional().default(20).describe('Maximum number of results (1-100, default: 20)'),
      offset: z.number().min(0).optional().default(0).describe('Number of results to skip for pagination'),
    });
  • src/server.ts:96-107 (registration)
    Registration of the search_firearms tool within the server request handler switch block.
    case 'search_firearms': {
      const input = searchFirearmsSchema.parse(args);
      const result = await searchFirearms(this.apiClient, input);
      return {
        content: [
          {
            type: 'text',
            text: result,
          },
        ],
      };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It compensates adequately by disclosing the return structure ('basic details including name, brand, caliber...') since no output schema exists. However, it omits error handling behavior, rate limits, and authorization 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?

Two sentences total with zero waste. The first sentence establishes the operation and target, the second discloses the return value structure. Information is front-loaded and every sentence earns its place.

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

Completeness4/5

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

Given the 100% schema coverage and absence of output schema, the description adequately compensates by listing return fields. It meets expectations for a search tool but could be improved by noting error cases (e.g., no results found) or authentication requirements.

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?

The input schema has 100% description coverage, establishing a baseline of 3. The description mentions 'search criteria' generally but does not add semantic context beyond the schema, such as query syntax examples or pagination strategy details.

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

Purpose5/5

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

The description clearly states the specific action ('Search') and resource ('Gunsnation firearms database'). It implicitly distinguishes from sibling 'get_firearm' by emphasizing 'search criteria' and returning a 'list' versus a single item retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the verb 'Search' versus the sibling's 'get', suggesting this is for finding multiple matches rather than specific ID lookup. However, it lacks explicit guidance on when to use this versus 'get_firearm' or prerequisites like authentication requirements.

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/DynamicDeals/mcp-server-gunsnation'

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