Skip to main content
Glama
ampcome-mcps

CircleCI MCP Server

by ampcome-mcps

config_helper

Analyze and validate CircleCI configuration files to identify and fix errors in YAML content.

Instructions

This tool helps analyze and validate and fix CircleCI configuration files.

Parameters:

  • params: An object containing:

    • configFile: string - The full contents of the CircleCI config file as a string. This should be the raw YAML content, not a file path.

Example usage: { "params": { "configFile": "version: 2.1 orbs: node: circleci/node@7 ..." } }

Note: The configFile content should be provided as a properly escaped string with newlines represented as .

Tool output instructions: - If the config is invalid, the tool will return the errors and the original config. Use the errors to fix the config. - If the config is valid, do nothing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNo

Implementation Reference

  • The main handler function for the 'config_helper' tool. It validates the provided CircleCI config file content using the CircleCI client's configValidate method and returns a success or error message.
    export const configHelper: ToolCallback<{
      params: typeof configHelperInputSchema;
    }> = async (args) => {
      const { configFile } = args.params;
    
      const circleci = getCircleCIClient();
      const configValidate = await circleci.configValidate.validateConfig({
        config: configFile,
      });
    
      if (configValidate.valid) {
        return {
          content: [
            {
              type: 'text',
              text: 'Your config is valid!',
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `There are some issues with your config: ${configValidate.errors?.map((error) => error.message).join('\n') ?? 'Unknown error'}`,
          },
        ],
      };
    };
  • Zod input schema for the config_helper tool, defining the 'configFile' parameter as a string.
    export const configHelperInputSchema = z.object({
      configFile: z
        .string()
        .describe(
          'The contents of the circleci config file. This should be the contents of the circleci config file, not the path to the file. Typically located at .circleci/config.yml',
        ),
    });
  • Tool registration object defining the 'config_helper' tool's metadata: name, description, and input schema reference.
    export const configHelperTool = {
      name: 'config_helper' as const,
      description: `
      This tool helps analyze and validate and fix CircleCI configuration files.
    
      Parameters:
      - params: An object containing:
        - configFile: string - The full contents of the CircleCI config file as a string. This should be the raw YAML content, not a file path.
    
      Example usage:
      {
        "params": {
          "configFile": "version: 2.1\norbs:\n  node: circleci/node@7\n..."
        }
      }
    
      Note: The configFile content should be provided as a properly escaped string with newlines represented as \n.
    
      Tool output instructions:
        - If the config is invalid, the tool will return the errors and the original config. Use the errors to fix the config.
        - If the config is valid, do nothing.
      `,
      inputSchema: configHelperInputSchema,
    };
  • Registration of config_helper tool (as configHelperTool) in the main CCI_TOOLS array.
    export const CCI_TOOLS = [
      getBuildFailureLogsTool,
      getFlakyTestLogsTool,
      getLatestPipelineStatusTool,
      getJobTestResultsTool,
      configHelperTool,
      createPromptTemplateTool,
      recommendPromptTemplateTestsTool,
      runPipelineTool,
      listFollowedProjectsTool,
      runEvaluationTestsTool,
      rerunWorkflowTool,
      analyzeDiffTool,
      runRollbackPipelineTool,
    ];
  • Maps the 'config_helper' name to its handler function (configHelper) in the CCI_HANDLERS object.
    export const CCI_HANDLERS = {
      get_build_failure_logs: getBuildFailureLogs,
      find_flaky_tests: getFlakyTestLogs,
      get_latest_pipeline_status: getLatestPipelineStatus,
      get_job_test_results: getJobTestResults,
      config_helper: configHelper,
      create_prompt_template: createPromptTemplate,
      recommend_prompt_template_tests: recommendPromptTemplateTests,
      run_pipeline: runPipeline,
      list_followed_projects: listFollowedProjects,
      run_evaluation_tests: runEvaluationTests,
      rerun_workflow: rerunWorkflow,
      analyze_diff: analyzeDiff,
      run_rollback_pipeline: runRollbackPipeline,
    } satisfies ToolHandlers;
Behavior4/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 discloses key behavioral traits: it analyzes/validates/fixes configs, returns errors for invalid configs with the original config, and does nothing for valid configs. It also notes the configFile should be a properly escaped string. This covers the core behavior well, though it doesn't mention rate limits, authentication needs, or detailed error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with sections (purpose, parameters, example, notes, output instructions), but it's somewhat verbose with redundant details (e.g., repeating configFile info). Sentences like 'The configFile content should be provided as a properly escaped string with newlines represented as \n.' could be more concise. It's front-loaded with purpose, but some parts feel unnecessary.

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 no annotations, no output schema, and 1 parameter with 0% schema coverage, the description does a good job of completeness. It explains the tool's purpose, parameter usage, example, and output behavior. However, it lacks details on error formats, what 'fix' entails (e.g., automatic corrections vs. suggestions), and integration with sibling tools, leaving some gaps for a config validation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds significant meaning: it explains that configFile is 'the full contents of the CircleCI config file as a string' and 'should be the raw YAML content, not a file path,' with an example and note about escaping. This clarifies the parameter's purpose and format beyond the bare schema, though it doesn't detail all possible input constraints.

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: 'analyze and validate and fix CircleCI configuration files.' It specifies the resource (CircleCI config files) and the actions (analyze, validate, fix). However, it doesn't explicitly differentiate from sibling tools like 'run_pipeline' or 'rerun_workflow' which might also interact with CircleCI configurations.

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 context through the example and output instructions, suggesting it's for validating/fixing configs before execution. However, it doesn't explicitly state when to use this vs. alternatives like 'run_pipeline' (which might validate as part of execution) or provide clear exclusions. The guidance is present but not explicit about alternatives.

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/ampcome-mcps/circleci-mcp'

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