Skip to main content
Glama
houtini-ai

Better Google Search Console

by houtini-ai

cancel_sync

Stop a running data synchronization job in the Better Google Search Console MCP server to halt ongoing data downloads into the local SQLite database.

Instructions

Cancel a running sync job. The job will stop gracefully after completing the current API call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYesJob ID to cancel.

Implementation Reference

  • src/server.ts:445-463 (registration)
    Tool registration for 'cancel_sync' with the MCP server, including the handler function that calls syncManager.cancelJob() and returns the job status or error
    server.tool(
      'cancel_sync',
      'Cancel a running sync job. The job will stop gracefully after completing the current API call.',
      {
        jobId: z.string().describe('Job ID to cancel.'),
      },
      async (args) => {
        try {
          const cancelled = syncManager.cancelJob(args.jobId);
          if (cancelled) {
            const status = syncManager.getStatus(args.jobId);
            return { content: [{ type: 'text', text: JSON.stringify(status, null, 2) }] };
          }
          return { content: [{ type: 'text', text: JSON.stringify({ error: `Job ${args.jobId} not found or already finished.` }) }], isError: true };
        } catch (error) {
          return { content: [{ type: 'text', text: JSON.stringify({ error: (error as Error).message }) }], isError: true };
        }
      }
    );
  • Core implementation of cancelJob() method that marks a job as cancelled by setting the cancelled flag and status, returns false if job doesn't exist or already finished
    cancelJob(jobId: string): boolean {
      const job = this.jobs.get(jobId);
      if (!job) return false;
      if (job.status === 'completed' || job.status === 'failed' || job.status === 'cancelled') {
        return false;
      }
      job.cancelled = true;
      job.status = 'cancelled';
      return true;
    }
  • Input schema definition using Zod - expects jobId as a string parameter to identify which job to cancel
    {
      jobId: z.string().describe('Job ID to cancel.'),
    },
  • Type definitions for SyncJobStatus and SyncStatus interfaces that define the structure of job status data returned by cancel_sync
    export type SyncJobStatus = 'queued' | 'syncing' | 'completed' | 'failed' | 'cancelled';
    
    export interface SyncJobResult {
      siteUrl: string;
      status: 'completed' | 'failed' | 'skipped' | 'cancelled';
      rowsFetched: number;
      rowsInserted: number;
      durationMs: number;
      error?: string;
      pruned?: {
        rowsDeleted: number;
        rowsAfter: number;
        spaceSavedMB: number;
      };
    }
    
    export interface SyncStatus {
      jobId: string;
      status: SyncJobStatus;
      totalProperties: number;
      completedProperties: number;
      currentProperty: string | null;
      rowsFetched: number;
      estimatedTotalRows: number | null;
      apiCallsMade: number;
      startedAt: string;
      elapsedMs: number;
      results: SyncJobResult[];
      error?: string;
    }
  • SyncJob interface definition that includes the cancelled boolean flag and status field modified by the cancelJob method
    interface SyncJob {
      id: string;
      status: SyncJobStatus;
      cancelled: boolean;
      properties: Array<{
        siteUrl: string;
        startDate?: string;
        endDate?: string;
        dimensions?: string[];
        searchType?: 'web' | 'discover' | 'googleNews' | 'image' | 'video';
      }>;
      totalProperties: number;
      completedProperties: number;
      currentProperty: string | null;
      rowsFetched: number;
      estimatedTotalRows: number | null;
      apiCallsMade: number;
      startedAt: number;
      results: SyncJobResult[];
      error?: string;
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 of behavioral disclosure. It effectively describes the tool's behavior ('stop gracefully after completing the current API call'), which clarifies that it's a controlled termination rather than an abrupt halt. However, it doesn't mention potential side effects, error conditions, or what happens if the job is already completed, leaving some behavioral aspects uncovered.

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 extremely concise and front-loaded, consisting of two clear sentences that directly state the purpose and behavior without any wasted words. Every sentence earns its place by providing essential information, making it highly efficient and well-structured for quick understanding.

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?

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is minimally complete. It covers the basic action and behavior but lacks details on error handling, return values, or integration with sibling tools. For a tool that modifies system state, more context would be beneficial, but it meets the minimum viable threshold.

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?

The schema description coverage is 100%, with the jobId parameter fully documented in the input schema. The description doesn't add any additional meaning or context beyond what the schema provides (e.g., format examples or source of the jobId). Since the schema handles the parameter documentation adequately, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 specific action ('Cancel a running sync job') and resource ('sync job'), distinguishing it from sibling tools like check_sync_status or sync_all_properties. It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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 when a sync job is running and needs to be stopped, but it doesn't explicitly state when to use this tool versus alternatives like prune_database or when not to use it (e.g., for non-running jobs). There's no mention of prerequisites or comparisons with other tools, leaving usage context partially inferred rather than explicitly guided.

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/houtini-ai/better-search-console'

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