Skip to main content
Glama
jaredhobbs

cronalert-mcp

create_monitor

Destructive

Set up automated URL monitoring to detect downtime by scheduling periodic checks and configuring alerts for failures.

Instructions

Create a new uptime monitor that periodically checks a URL and alerts on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name for the monitor
urlYesURL to monitor
checkIntervalNoCheck interval in seconds (default 180)
methodNoHTTP method (default GET)GET
expectedStatusCodeNoExpected HTTP status code (default 200)

Implementation Reference

  • The create_monitor handler function that executes when the tool is called. It constructs a request with name, url, checkInterval, method, and expectedStatusCode, then POSTs to /monitors endpoint via apiRequest.
    async ({ name, url, checkInterval, method, expectedStatusCode }) => {
      const data = await apiRequest("/monitors", {
        method: "POST",
        body: JSON.stringify({ name, url, checkInterval, method, expectedStatusCode }),
      });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • Input schema validation for create_monitor using zod. Defines required fields: name (string), url (string with URL validation), and optional fields: checkInterval (number, default 180), method (enum, default GET), expectedStatusCode (number, default 200).
    {
      name: z.string().describe("Display name for the monitor"),
      url: z.string().url().describe("URL to monitor"),
      checkInterval: z.number().int().positive().optional().default(180).describe("Check interval in seconds (default 180)"),
      method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]).optional().default("GET").describe("HTTP method (default GET)"),
      expectedStatusCode: z.number().int().optional().default(200).describe("Expected HTTP status code (default 200)"),
    },
  • src/index.ts:82-105 (registration)
    Full tool registration for create_monitor using server.tool(). Includes tool name, description, schema definition, execution hints (readOnlyHint: false, destructiveHint: true), and the async handler function.
    server.tool(
      "create_monitor",
      "Create a new uptime monitor that periodically checks a URL and alerts on failure.",
      {
        name: z.string().describe("Display name for the monitor"),
        url: z.string().url().describe("URL to monitor"),
        checkInterval: z.number().int().positive().optional().default(180).describe("Check interval in seconds (default 180)"),
        method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]).optional().default("GET").describe("HTTP method (default GET)"),
        expectedStatusCode: z.number().int().optional().default(200).describe("Expected HTTP status code (default 200)"),
      },
      {
    
          readOnlyHint: false,
          destructiveHint: true,
          openWorldHint: false,
      },
      async ({ name, url, checkInterval, method, expectedStatusCode }) => {
        const data = await apiRequest("/monitors", {
          method: "POST",
          body: JSON.stringify({ name, url, checkInterval, method, expectedStatusCode }),
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The apiRequest helper function used by create_monitor handler. Handles API authentication via Bearer token, sets Content-Type headers, makes HTTP requests to the CronAlert API, and handles error responses.
    async function apiRequest(
      path: string,
      options: RequestInit = {}
    ): Promise<unknown> {
      const apiKey = getApiKey();
      const url = `${API_BASE}${path}`;
    
      const response = await fetch(url, {
        ...options,
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
          ...options.headers,
        },
      });
    
      if (!response.ok) {
        const body = await response.text();
        throw new Error(`API error ${response.status}: ${body}`);
      }
    
      return response.json();
    }
Behavior4/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, which the description aligns with by describing a creation action. The description adds useful context beyond annotations: it specifies the monitor's purpose (periodic URL checks and alerting on failure), which isn't covered by annotations. However, it doesn't detail rate limits, authentication needs, or specific alert mechanisms.

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, well-structured sentence that efficiently conveys the tool's purpose without unnecessary words. It's front-loaded with the main action and includes essential details (URL checking, alerting) in a compact form.

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 the tool's complexity (creation with 5 parameters), annotations cover safety (destructive), and schema fully describes inputs, the description provides adequate context. It explains what the monitor does (checks URL, alerts) but lacks output details (no output schema) and doesn't mention error handling or response format, leaving minor gaps.

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?

Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description doesn't add any parameter-specific details beyond what's in the schema (e.g., it doesn't explain 'checkInterval' or 'method' further). Baseline is 3 as the schema does the heavy lifting, but no extra value is provided.

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 action ('create a new uptime monitor') and specifies the resource ('that periodically checks a URL and alerts on failure'). It distinguishes from siblings like 'get_monitor' or 'update_monitor' by emphasizing creation rather than retrieval or modification.

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 for setting up URL monitoring but doesn't explicitly state when to use this vs. alternatives like 'update_monitor' or prerequisites. It mentions 'alerts on failure' which hints at its purpose, but lacks explicit guidance on when-not-to-use or comparisons with sibling tools.

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/jaredhobbs/cronalert-mcp'

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