Skip to main content
Glama

link_automation_rule

Link an automation rule to a test cycle using the automation rule key and test cycle ID. Enables the rule to be triggered for that cycle.

Instructions

Associate an automation rule with a test cycle so it can be triggered for that cycle. automationRuleKey is the rule's string key from your QMetry automation config. Returns 200 on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cycleIdYesTest cycle ID
automationRuleKeyYesAutomation rule key to link

Implementation Reference

  • The async handler function that executes the 'link_automation_rule' tool logic. It calls the QTMetry API at /testcycles/{cycleId}/automation-rule/link/{automationRuleKey} via PUT to associate an automation rule with a test cycle, then wraps the response using the ok() helper.
    async ({ cycleId, automationRuleKey }) => {
      const data = await qtmFetch(
        `/testcycles/${cycleId}/automation-rule/link/${automationRuleKey}`,
        { method: "PUT", body: JSON.stringify({}) }
      );
      return ok(data ?? { message: "Automation rule linked" });
    }
  • Input schema for the 'link_automation_rule' tool: requires cycleId (string or number) and automationRuleKey (string), validated via Zod.
    {
      cycleId: ID.describe("Test cycle ID"),
      automationRuleKey: z.string().describe("Automation rule key to link"),
    },
  • src/index.ts:687-701 (registration)
    Registration of the 'link_automation_rule' tool via the local 'tool()' wrapper function, which delegates to server.registerTool on the McpServer instance at line 179.
    tool(
      "link_automation_rule",
      "Associate an automation rule with a test cycle so it can be triggered for that cycle. automationRuleKey is the rule's string key from your QMetry automation config. Returns 200 on success.",
      {
        cycleId: ID.describe("Test cycle ID"),
        automationRuleKey: z.string().describe("Automation rule key to link"),
      },
      async ({ cycleId, automationRuleKey }) => {
        const data = await qtmFetch(
          `/testcycles/${cycleId}/automation-rule/link/${automationRuleKey}`,
          { method: "PUT", body: JSON.stringify({}) }
        );
        return ok(data ?? { message: "Automation rule linked" });
      }
    );
  • The ok() helper function used by the handler to wrap the API response into the expected MCP tool content format.
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • The 'tool()' wrapper helper that registers tools on the McpServer instance, reducing boilerplate for each tool definition.
    const tool = <Shape extends z.ZodRawShape>(
      name: string,
      description: string,
      inputSchema: Shape,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      callback: (args: z.infer<z.ZodObject<Shape>>) => Promise<any>
    ) =>
      server.registerTool(
        name,
        { description, inputSchema },
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        callback as any
      );
Behavior2/5

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

With no annotations, the description should disclose more behavioral traits. It only mentions a 200 success return, but not side effects, idempotency, or error conditions.

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?

Two concise sentences, front-loaded with purpose, no extraneous information.

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?

No output schema, but description mentions return value. Missing details on error responses and behavior for duplicate links, though tool is simple.

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 has 100% coverage, and the description adds value by specifying that automationRuleKey is from QMetry automation config, providing context beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Associate' and the resources 'automation rule' and 'test cycle', which distinguishes it from siblings like unlink_automation_rule and run_automation_rules.

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?

No explicit guidance on when to use versus alternatives; implies linking before triggering but lacks prerequisites or exclusions.

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/salehrifai42/qmetrymcp'

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