Skip to main content
Glama

check_clojars_version_exists

Verify the existence of a specific version of a Clojars dependency to ensure its availability for your project.

Instructions

Check if a specific version of a Clojars dependency exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependencyYesClojars dependency name in format "group/artifact" (e.g. "metosin/reitit")
versionYesVersion to check (e.g. "0.7.2")

Implementation Reference

  • Executes the tool logic: validates input, fetches maven-metadata.xml from Clojars, parses versions, checks if specified version exists, returns JSON result or error.
    } else if (request.params.name === 'check_clojars_version_exists') {
      if (!isValidVersionCheckArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments. Expected "dependency" in format "group/artifact" and "version"'
        );
      }
    
      const [group, artifact] = request.params.arguments.dependency.split('/');
      const version = request.params.arguments.version;
    
      try {
        const response = await this.axiosInstance.get<string>(
          `/${group.replace(/\./g, '/')}/${artifact}/maven-metadata.xml`
        );
    
        // Extract all versions from XML
        const versionsMatch = response.data.match(/<version>(.*?)<\/version>/g);
        const versions = versionsMatch?.map(v => v.replace(/<\/?version>/g, '')) || [];
    
        const exists = versions.includes(version);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  dependency: `${group}/${artifact}`,
                  version: version,
                  exists: exists
                },
                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:90-107 (registration)
    Registers the tool in the ListTools response, including name, description, and input schema.
    {
      name: 'check_clojars_version_exists',
      description: 'Check if a specific version of a Clojars dependency exists',
      inputSchema: {
        type: 'object',
        properties: {
          dependency: {
            type: 'string',
            description: 'Clojars dependency name in format "group/artifact" (e.g. "metosin/reitit")',
          },
          version: {
            type: 'string',
            description: 'Version to check (e.g. "0.7.2")',
          },
        },
        required: ['dependency', 'version'],
      },
    },
  • Input schema definition for the tool parameters: dependency (group/artifact) and version.
    inputSchema: {
      type: 'object',
      properties: {
        dependency: {
          type: 'string',
          description: 'Clojars dependency name in format "group/artifact" (e.g. "metosin/reitit")',
        },
        version: {
          type: 'string',
          description: 'Version to check (e.g. "0.7.2")',
        },
      },
      required: ['dependency', 'version'],
    },
  • Helper function to validate the tool's input arguments (dependency format and version string).
    const isValidVersionCheckArgs = (args: any): args is { dependency: string; version: string } =>
      typeof args === 'object' &&
      args !== null &&
      typeof args.dependency === 'string' &&
      args.dependency.includes('/') &&
      typeof args.version === 'string';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Check' implies a read-only operation, it doesn't specify whether this is a safe lookup, what happens on failure (e.g., error handling), or any rate limits or authentication requirements. The description is too minimal for a mutation-free 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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy 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 (simple lookup with two parameters) and 100% schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it lacks details on return values (e.g., boolean, error messages) or behavioral context, leaving gaps for the agent.

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, fully documenting both parameters (dependency and version) with examples. The description adds no additional parameter semantics beyond what the schema already provides, so it meets the baseline of 3 without adding value.

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 tool's purpose with a specific verb ('Check') and resource ('specific version of a Clojars dependency'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from its siblings (get_clojars_history and get_clojars_latest_version), which would require a 5.

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 or alternatives. There's no mention of use cases, prerequisites, or exclusions, leaving the agent with no contextual direction for tool selection.

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