Skip to main content
Glama
houtini-ai

Better Google Search Console

by houtini-ai

check_sync_status

Monitor background sync job progress for Google Search Console data downloads. Check specific jobs or view all active/recent syncs to track data import status.

Instructions

Check the status of a background sync job. If no jobId provided, returns all active and recent jobs. Use after sync_gsc_data or sync_all_properties to monitor progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdNoJob ID from sync_gsc_data or sync_all_properties. Omit to see all jobs.

Implementation Reference

  • Handler function for check_sync_status tool that calls syncManager.getStatus() and returns JSON status. Handles errors and returns them as error responses.
    async (args) => {
      try {
        const status = syncManager.getStatus(args.jobId);
        return { content: [{ type: 'text', text: JSON.stringify(status, null, 2) }] };
      } catch (error) {
        return { content: [{ type: 'text', text: JSON.stringify({ error: (error as Error).message }) }], isError: true };
      }
    }
  • Core getStatus method that retrieves status for a specific jobId or returns all jobs. Returns SyncStatus object(s) with job progress, results, and error information.
    getStatus(jobId?: string): SyncStatus | SyncStatus[] {
      if (jobId) {
        const job = this.jobs.get(jobId);
        if (!job) {
          return {
            jobId,
            status: 'failed',
            totalProperties: 0,
            completedProperties: 0,
            currentProperty: null,
            rowsFetched: 0,
            estimatedTotalRows: null,
            apiCallsMade: 0,
            startedAt: '',
            elapsedMs: 0,
            results: [],
            error: `Job ${jobId} not found. It may have expired from history.`,
          };
        }
        return this.jobToStatus(job);
      }
      return this.jobOrder.map(id => this.jobToStatus(this.jobs.get(id)!));
    }
  • src/server.ts:425-439 (registration)
    Registration of check_sync_status tool with MCP server. Defines tool name, description, input schema (optional jobId parameter), and handler function.
    server.tool(
      'check_sync_status',
      'Check the status of a background sync job. If no jobId provided, returns all active and recent jobs. Use after sync_gsc_data or sync_all_properties to monitor progress.',
      {
        jobId: z.string().optional().describe('Job ID from sync_gsc_data or sync_all_properties. Omit to see all jobs.'),
      },
      async (args) => {
        try {
          const status = syncManager.getStatus(args.jobId);
          return { content: [{ type: 'text', text: JSON.stringify(status, null, 2) }] };
        } catch (error) {
          return { content: [{ type: 'text', text: JSON.stringify({ error: (error as Error).message }) }], isError: true };
        }
      }
    );
  • SyncStatus interface defining the structure of sync job status returned by check_sync_status. Includes jobId, status, progress metrics, timing, and results array.
    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;
    }

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-google-search-console'

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