Skip to main content
Glama

get_file_status

Check DOCX or Google Docs file metadata including edit history, normalization statistics, and cache information to monitor document changes and processing status.

Instructions

Get file/session metadata including edit count, normalization stats, and cache info. Supports DOCX and Google Docs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNoPath to the DOCX file.
google_doc_idNoGoogle Doc ID or URL (alternative to file_path). Extract from URL: docs.google.com/document/d/{ID}/edit

Implementation Reference

  • Main implementation of the 'get_file_status' tool handler for docx-mcp.
    export async function getFileStatus(
      manager: SessionManager,
      params: { file_path?: string },
    ): Promise<ToolResponse> {
      try {
        const resolved = await resolveSessionForTool(manager, params, { toolName: 'get_file_status' });
        if (!resolved.ok) return resolved.response;
        const { session, metadata } = resolved;
        return ok(mergeSessionResolutionMetadata({
          file_path: manager.normalizePath(session.originalPath),
          created_at: session.createdAt.toISOString(),
          expires_at: session.expiresAt.toISOString(),
          last_activity: session.lastAccessedAt.toISOString(),
          edit_count: session.editCount,
          edit_revision: session.editRevision,
          cached_save_artifacts: session.saveCache.size,
          save_defaults: {
            default_variants: ['clean', 'redline'],
            default_save_format: 'both',
            supports_variant_override: true,
          },
          document: { filename: session.filename },
          normalization: session.normalizationStats
            ? {
                runs_merged: session.normalizationStats.runsMerged,
                proof_errors_removed: session.normalizationStats.proofErrRemoved,
                redlines_simplified: session.normalizationStats.wrappersConsolidated,
                double_elevations_fixed: session.normalizationStats.doubleElevationsFixed,
                normalization_skipped: false,
              }
            : { runs_merged: 0, redlines_simplified: 0, double_elevations_fixed: 0, normalization_skipped: true },
        }, metadata));
      } catch (e: unknown) {
        const msg = errorMessage(e);
        return err('STATUS_ERROR', msg);
      }
    }
  • Alternative implementation of the 'get_file_status' tool handler specifically for GDocs sessions.
    export async function gdocsGetFileStatus(
      _manager: SessionManager,
      session: GDocsSession,
      _params: Record<string, unknown>,
      metadata: Record<string, unknown>,
    ): Promise<ToolResponse> {
      try {
        return ok({
          google_doc_id: session.docId,
          provider: 'gdocs',
          created_at: session.createdAt.toISOString(),
          expires_at: session.expiresAt.toISOString(),
          last_activity: session.lastAccessedAt.toISOString(),
          edit_count: session.editCount,
          edit_revision: session.editRevision,
          revision_id: session.doc.getRevisionId(),
          is_revision_fresh: session.doc.isRevisionFresh(),
          tabs: session.doc.getTabs(),
          ...metadata,
        });
      } catch (e: unknown) {
        return err('STATUS_ERROR', e instanceof Error ? e.message : String(e));
      }
    }

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/UseJunior/safe-docx'

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