Skip to main content
Glama

proxy_import_har

Import HAR files from disk to create queryable sessions for analyzing and replaying captured network traffic.

Instructions

Import a HAR file from disk into a new persisted session for querying, findings, and replay.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
har_fileYesPath to HAR file on disk
session_nameNoOptional name for the imported session
storage_dirNoOptional custom session storage directory
max_disk_mbNoSession disk cap in MB
strictNoWhen true, abort on first invalid HAR entry; when false, skip invalid entries

Implementation Reference

  • The handler for the 'proxy_import_har' tool, which takes a file path and import settings, delegates to `proxyManager.importHarAsSession`, and returns the result.
    server.tool(
      "proxy_import_har",
      "Import a HAR file from disk into a new persisted session for querying, findings, and replay.",
      {
        har_file: z.string().describe("Path to HAR file on disk"),
        session_name: z.string().optional().describe("Optional name for the imported session"),
        storage_dir: z.string().optional().describe("Optional custom session storage directory"),
        max_disk_mb: z.number().optional().default(1024).describe("Session disk cap in MB"),
        strict: z.boolean().optional().default(false)
          .describe("When true, abort on first invalid HAR entry; when false, skip invalid entries"),
      },
      async ({ har_file, session_name, storage_dir, max_disk_mb, strict }) => {
        try {
          const result = await proxyManager.importHarAsSession({
            harFile: har_file,
            sessionName: session_name,
            storageDir: storage_dir,
            maxDiskMb: max_disk_mb,
            strict,
          });
          return {
            content: [{ type: "text", text: truncateResult({ status: "success", ...result }) }],
          };
        } catch (e) {
          return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: toError(e) }) }] };
        }
      },
    );
  • The actual implementation of importHarAsSession, which delegates to the session store.
    async importHarAsSession(opts: HarImportOptions): Promise<{ session: SessionManifest; importSummary: HarImportSummary }> {
      return await this.sessionStore.importHar(opts);
    }
  • Tool definition and registration of 'proxy_import_har'.
    server.tool(
      "proxy_import_har",
      "Import a HAR file from disk into a new persisted session for querying, findings, and replay.",
      {
        har_file: z.string().describe("Path to HAR file on disk"),
        session_name: z.string().optional().describe("Optional name for the imported session"),
        storage_dir: z.string().optional().describe("Optional custom session storage directory"),
        max_disk_mb: z.number().optional().default(1024).describe("Session disk cap in MB"),
        strict: z.boolean().optional().default(false)
          .describe("When true, abort on first invalid HAR entry; when false, skip invalid entries"),
      },
      async ({ har_file, session_name, storage_dir, max_disk_mb, strict }) => {
        try {
          const result = await proxyManager.importHarAsSession({
            harFile: har_file,
            sessionName: session_name,
            storageDir: storage_dir,
            maxDiskMb: max_disk_mb,
            strict,
          });
          return {

Tool Definition Quality

Score is being calculated. Check back soon.

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/yfe404/proxy-mcp'

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