Skip to main content
Glama

watch_url

Monitor HTTP endpoints for status or content changes by polling at configurable intervals. Detect modifications and trigger events when updates occur.

Instructions

Poll an HTTP endpoint and emit events when status or body changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to poll
intervalNoPoll interval in seconds (default: 30)
expectNo
action_idNoLink events to an agent action

Implementation Reference

  • The handler implementation for the 'watch_url' MCP tool, which validates arguments, creates a watch record, stores it, and starts the watcher.
    private async handleWatchUrl(args: Record<string, unknown>) {
      const schema = z.object({
        url: z.string(),
        interval: z.number().optional(),
        method: z.string().optional(),
        expect: z.object({
          status: z.number().optional(),
          body_contains: z.string().optional(),
        }).optional(),
        action_id: z.string().optional(),
      });
      const parsed = schema.parse(args);
      const id = uuidv4();
      const now = new Date().toISOString();
    
      const config: HttpConfig = { kind: 'http', ...parsed };
      const watch: WatchRecord = {
        id,
        kind: 'http',
        config,
        action_id: parsed.action_id ?? null,
        created_at: now,
        active: true,
        last_poll_at: null,
      };
    
      insertWatch(watch);
      const watcher = new HttpWatcher(id, parsed.action_id ?? null, this.registry.getNotifyFn(), config);
      this.registry.register(watcher);
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ watch_id: id, status: 'polling', url: parsed.url }),
        }],
      };
    }
    
    private async handleWatchWebhook(args: Record<string, unknown>) {
      const schema = z.object({
        source_type: z.string(),
        port: z.number().optional(),
        filter: z.record(z.unknown()).optional(),
        action_id: z.string().optional(),
      });
      const parsed = schema.parse(args);
      const id = uuidv4();
      const now = new Date().toISOString();
  • The Zod schema used to validate the input arguments for the 'watch_url' tool.
    const schema = z.object({
      url: z.string(),
      interval: z.number().optional(),
      method: z.string().optional(),
      expect: z.object({
        status: z.number().optional(),
        body_contains: z.string().optional(),
      }).optional(),
      action_id: z.string().optional(),
    });
  • src/server.ts:99-104 (registration)
    The registration of the 'watch_url' tool within the MCP tool list.
    name: 'watch_url',
    description: 'Poll an HTTP endpoint and emit events when status or body changes',
    inputSchema: {
      type: 'object',
      properties: {
        url: { type: 'string', description: 'URL to poll' },
Behavior2/5

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

No annotations are provided, so the description must carry full behavioral disclosure. It mentions polling and emitting events, but omits crucial operational context: that this creates a persistent resource consuming resources indefinitely, that events likely accumulate until retrieved via poll_events, or any rate limiting/timeout behavior.

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?

Single sentence, front-loaded with the verb phrase 'Poll an HTTP endpoint'. No redundant words or tautology. Efficiently conveys the core mechanism without waste.

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?

Adequately describes the immediate polling behavior but lacks operational completeness for a stateful 4-parameter tool. Given the presence of cancel_watch/list_watches siblings, the description should mention the watch lifecycle (creation/cancellation) which it omits.

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 coverage is 75% at the top level (url, interval, action_id described; expect object not described at top level). The description mentions 'status or body changes' which implicitly maps to the expect parameter's function, but doesn't explain the nested structure or semantics of action_id. Baseline 3 appropriate given schema coverage.

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?

Clearly states the specific action (poll), resource (HTTP endpoint), and trigger condition (status or body changes). Distinguishes from file/process/ci watching siblings via 'HTTP endpoint' specificity, though it doesn't clarify the difference between polling an endpoint versus watching a webhook.

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?

Provides no guidance on when to use this tool versus siblings like watch_webhook or watch_ci. Critically, it fails to mention that this creates a persistent watch that requires cancellation via cancel_watch or listing via list_watches, which are available siblings.

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/jarvisassistantux/loopsense'

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