Skip to main content
Glama

get_clojars_history

Retrieve version history for a Clojars dependency, specifying the number of versions to return, up to a maximum of 100, for tracking library updates.

Instructions

Get version history of a Clojars dependency

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependencyYesClojars dependency name in format "group/artifact" (e.g. "metosin/reitit")
limitNoNumber of versions to return (default: 15, max: 100)

Implementation Reference

  • The main handler for the 'get_clojars_history' tool. Validates input, fetches maven-metadata.xml from Clojars, extracts all versions, slices the most recent 'limit' (default 15), reverses to chronological order, and returns JSON with versions, total count, and shown count. Handles 404 and other errors.
    } else if (request.params.name === 'get_clojars_history') {
      if (!isValidHistoryArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments. Expected "dependency" in format "group/artifact" and optional "limit" (1-100)'
        );
      }
    
      const [group, artifact] = request.params.arguments.dependency.split('/');
      const limit = request.params.arguments.limit || 15;
    
      try {
        const response = await this.axiosInstance.get<string>(
          `/${group.replace(/\./g, '/')}/${artifact}/maven-metadata.xml`
        );
    
        const versionsMatch = response.data.match(/<version>(.*?)<\/version>/g);
        const allVersions = versionsMatch?.map(v => v.replace(/<\/?version>/g, '')) || [];
        
        const versions = allVersions.slice(-limit).reverse();
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  dependency: `${group}/${artifact}`,
                  versions: versions,
                  total_versions: allVersions.length,
                  showing: versions.length
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          const message = error.response?.status === 404
            ? `Dependency ${group}/${artifact} not found on Clojars`
            : `Clojars API error: ${error.message}`;
          
          return {
            content: [
              {
                type: 'text',
                text: message,
              },
            ],
            isError: true,
          };
        }
        throw error;
      }
  • src/index.ts:108-127 (registration)
    Registration of the 'get_clojars_history' tool in the MCP server's tool list, including name, description, and input schema definition.
    {
      name: 'get_clojars_history',
      description: 'Get version history of a Clojars dependency',
      inputSchema: {
        type: 'object',
        properties: {
          dependency: {
            type: 'string',
            description: 'Clojars dependency name in format "group/artifact" (e.g. "metosin/reitit")',
          },
          limit: {
            type: 'number',
            description: 'Number of versions to return (default: 15, max: 100)',
            minimum: 1,
            maximum: 100,
          },
        },
        required: ['dependency'],
      },
    },
  • Type guard and validation function for the input arguments of the 'get_clojars_history' tool, ensuring correct dependency format and optional limit constraints.
    const isValidHistoryArgs = (args: any): args is { dependency: string; limit?: number } =>
      typeof args === 'object' &&
      args !== null &&
      typeof args.dependency === 'string' &&
      args.dependency.includes('/') &&
      (args.limit === undefined || (typeof args.limit === 'number' && args.limit > 0 && args.limit <= 100));
Behavior2/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 states what the tool does but doesn't mention important behavioral aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error conditions, or what format the version history is returned in. The description is minimal and lacks operational context.

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 - a single sentence that states the core purpose without any unnecessary words. It's front-loaded with the essential information and wastes no space on redundant details.

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

Completeness2/5

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

Given that there are no annotations and no output schema, the description is incomplete for a tool with 2 parameters. While concise, it doesn't provide enough context about what the tool returns, how errors are handled, or operational constraints. For a tool that presumably returns structured version history data, more context would be helpful.

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%, with both parameters well-documented in the input schema. The description doesn't add any parameter semantics beyond what's already in the schema - it doesn't explain the dependency format further or provide additional context about the limit parameter. This meets the baseline expectation when schema coverage is complete.

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 ('version history of a Clojars dependency'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_clojars_latest_version' (which returns only the latest version) or 'check_clojars_version_exists' (which checks existence of a specific version).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings. There's no mention of alternatives, prerequisites, or contextual factors that would help an agent choose between 'get_clojars_history', 'get_clojars_latest_version', or 'check_clojars_version_exists'.

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/Bigsy/Clojars-MCP-Server'

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