Skip to main content
Glama

config_helper

Analyze, validate, and fix CircleCI configuration files by providing raw YAML content. Returns errors for invalid configs or confirms validity, ensuring accurate workflow setup.

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

NameRequiredDescriptionDefault
paramsNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "params": { "additionalProperties": false, "properties": { "configFile": { "description": "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", "type": "string" } }, "required": [ "configFile" ], "type": "object" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'config_helper' tool. It validates the provided CircleCI config file using the CircleCI client and returns validation results.
    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 defining the parameters for the config_helper tool, specifically the configFile 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 name 'config_helper', description, and linking to the input schema.
    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, };
  • Central registration of all CircleCI tools, mapping 'config_helper' to its handler function.
    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;

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