Skip to main content
Glama
chezsmithy

Thunder Client License Manager MCP Server

by chezsmithy

thunderclient_get_licenses

Retrieve Thunder Client licenses from the API, with an option to fetch specific pages or automatically gather all available data for comprehensive management.

Instructions

Get Thunder Client licenses. If pageNumber is not provided, fetches all pages automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNumberNoSpecific page number to fetch (optional, fetches all pages if omitted)

Implementation Reference

  • Core handler implementation for thunderclient_get_licenses tool. Handles optional pagination: fetches specific page or all pages by looping through API responses.
    async getLicenses(request: GetLicensesRequest): Promise<ApiResponse<GetLicensesResponse | PaginatedLicensesResponse>> {
      const accountNumber = this.getAccountNumber();
    
      try {
        // If pageNumber is specified, fetch only that page
        if (request.pageNumber !== undefined) {
          const result = await this.getLicensesPage(accountNumber, request.pageNumber);
          
          if (!result) {
            return {
              success: false,
              error: `Failed to fetch page ${request.pageNumber}`
            };
          }
    
          return {
            success: true,
            data: result,
            message: `Retrieved page ${request.pageNumber} of licenses`
          };
        }
    
        // If no pageNumber specified, fetch all pages
        const allLicenses: LicenseInfo[] = [];
        let currentPage = 1;
        let totalPages = 1;
        let totalCount = 0;
        const maxPages = 100; // Safety limit to prevent infinite loops
    
        while (currentPage <= totalPages && currentPage <= maxPages) {
          const result = await this.getLicensesPage(accountNumber, currentPage);
          
          if (!result) {
            break;
          }
    
          allLicenses.push(...result.licenses);
          totalPages = result.totalPages;
          totalCount = result.totalCount;
    
          if (!result.hasMore || currentPage >= totalPages) {
            break;
          }
    
          currentPage++;
        }
    
        const paginatedResponse: PaginatedLicensesResponse = {
          licenses: allLicenses,
          totalPages: totalPages,
          totalCount: totalCount,
          pagesFetched: currentPage
        };
    
        return {
          success: true,
          data: paginatedResponse,
          message: `Retrieved ${allLicenses.length} licenses across ${currentPage} page(s)`
        };
    
      } catch (error) {
        return {
          success: false,
          error: `Request failed: ${error instanceof Error ? error.message : String(error)}`
        };
      }
    }
  • MCP CallToolRequestSchema dispatch handler for thunderclient_get_licenses, delegates to API client and formats response as text content.
    case 'thunderclient_get_licenses': {
      const getRequest = (args || {}) as unknown as GetLicensesRequest;
      const result = await this.apiClient.getLicenses(getRequest);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/index.ts:92-106 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: 'thunderclient_get_licenses',
      description: 'Get Thunder Client licenses. If pageNumber is not provided, fetches all pages automatically.',
      inputSchema: {
        type: 'object',
        properties: {
          pageNumber: {
            type: 'number',
            description: 'Specific page number to fetch (optional, fetches all pages if omitted)',
            minimum: 1,
          },
        },
        required: [],
      },
    },
  • Helper function to fetch and transform a single page of licenses from the Thunder Client API endpoint.
    private async getLicensesPage(accountNumber: string, pageNumber: number): Promise<GetLicensesResponse | null> {
      const url = new URL(`${this.config.baseUrl}/api/license/query`);
      url.searchParams.set('accountNumber', accountNumber);
      url.searchParams.set('pageNumber', pageNumber.toString());
    
      try {
        const response = await fetch(url.toString(), {
          method: 'GET',
          headers: this.getHeaders()
        });
    
        if (!response.ok) {
          const errorText = await response.text();
          throw new Error(`HTTP ${response.status}: ${response.statusText} - ${errorText}`);
        }
    
        const data = await response.json();
        
        // Thunder Client API uses 'teamMembers' for license data
        const licenseArray = data.teamMembers || [];
        
        // Transform the response to match our expected structure
        return {
          licenses: licenseArray,
          currentPage: pageNumber,
          totalPages: data.totalPages || 1,
          totalCount: data.usedSeats || licenseArray.length,
          hasMore: data.hasMore !== undefined ? data.hasMore : (pageNumber < (data.totalPages || 1))
        };
      } catch (error) {
        console.error(`Failed to fetch page ${pageNumber}:`, error);
        return null;
      }
    }
  • TypeScript interface defining the input schema for the getLicenses tool (matches MCP inputSchema).
    export interface GetLicensesRequest {
      pageNumber?: number;
    }
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 of behavioral disclosure. It adds useful context about the automatic pagination behavior when pageNumber is not provided, which isn't obvious from the schema. However, it doesn't cover other aspects like rate limits, authentication needs, or response format, leaving gaps for a tool with no annotation support.

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 extremely concise—just two sentences—with zero wasted words. It front-loads the core purpose and efficiently explains the key behavioral nuance regarding pagination, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is adequate but not complete. It covers the main functionality and pagination behavior but lacks details on output format, error handling, or integration with sibling tools, which could help an agent use it more effectively.

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 schema description coverage is 100%, so the schema already fully documents the single parameter (pageNumber). The description adds minimal value by restating that omitting pageNumber fetches all pages, which is already implied in the schema's description. This meets the baseline for high schema coverage without significant enhancement.

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 verb ('Get') and resource ('Thunder Client licenses'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'thunderclient_add_license' or 'thunderclient_remove_license' beyond implying this is a read operation versus their write operations.

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 provides implied usage guidance by mentioning the automatic fetching of all pages when pageNumber is omitted, which suggests when to use this parameter. However, it lacks explicit guidance on when to choose this tool over siblings or any prerequisites, leaving the agent to infer based on tool names alone.

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/chezsmithy/thunderclient-license-manager-mcp'

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