Topolo Docs Topolo Platform
Open workspace

Search files

Search permitted file metadata and indexed content. Search can generate derived thumbnails and backfill up to six missing semantic index entries.

Outcome

Search permitted file metadata and indexed content. Search can generate derived thumbnails and backfill up to six missing semantic index entries.

Before you start

  • Verify identity, pin environment and organization, and discover a granted Bytes workspace before choosing file keys.
  • The action requires files:read. Select a verified workspace resource separately from action input; a body field cannot supply a workspace grant.
  • Scope org uses the verified workspace shared root; private uses the caller’s private subtree. The accepted legacy all value resolves to org and does not grant cross-organization browsing. The bucket input cannot switch the configured R2 binding.
  • Authorize the described effect or private-data export before passing CLI --confirm or MCP confirm:true. GET listing/search can persist derived data; HTTP method alone does not establish a read-only action.

Discover the target

topolo whoami --json
topolo actions get app_topolo_bytes.files.search --detail --json
topolo resources topolo-bytes --json
topolo workspaces list topolo-bytes --json
  • File keys are paths returned by files.list/search in the selected workspace and scope. Discover the granted workspace id; do not derive access from fixture ids.

Request

GET /api/search

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and the HTTP body. Set BYTES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
prefixOptionalstring{}
cursorOptionalstring{}
fileTypeOptionalstring{}
sizeMinOptionalstring{}
sizeMaxOptionalstring{}
dateFromOptionalstring{}
dateToOptionalstring{}
durationMinOptionalstring{}
durationMaxOptionalstring{}
searchOptionalstring{}
sortByOptionalstring{}
sortOrderOptionalstring{}
bucketOptionalstring{"minLength":1}
scopeOptionalstring{"enum":["org","private","all"]}
limitOptionalinteger{"minimum":1,"maximum":9007199254740991}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "prefix": {
      "type": "string"
    },
    "cursor": {
      "type": "string"
    },
    "fileType": {
      "type": "string"
    },
    "sizeMin": {
      "type": "string"
    },
    "sizeMax": {
      "type": "string"
    },
    "dateFrom": {
      "type": "string"
    },
    "dateTo": {
      "type": "string"
    },
    "durationMin": {
      "type": "string"
    },
    "durationMax": {
      "type": "string"
    },
    "search": {
      "type": "string"
    },
    "sortBy": {
      "type": "string"
    },
    "sortOrder": {
      "type": "string"
    },
    "bucket": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "string",
      "enum": [
        "org",
        "private",
        "all"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "additionalProperties": false
}

Effects

  • Reads lexical and semantic matches and can write derived thumbnails, index metadata and semantic vectors.

Interpret the response

The response identifier path is $.files[].key for file. An empty list does not discover a target.

Follow cursor when truncated; inspect query and appliedFilters. An empty result does not prove a file is absent from every page or that semantic indexing is configured.

The schema describes supported success fields; optional metadata and integration-dependent values may vary. Errors have the exact shapes shown in refused examples.

Success schema:

{
  "type": "object",
  "required": [
    "files",
    "totalFound",
    "pageCount",
    "truncated",
    "cursor",
    "query",
    "appliedFilters"
  ],
  "properties": {
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "size",
          "uploaded",
          "url",
          "type",
          "folder",
          "filename",
          "thumb",
          "relevanceScore"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "size": {
            "type": "number"
          },
          "uploaded": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "folder": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "thumb": {
            "type": "string"
          },
          "relevanceScore": {
            "type": "number"
          }
        }
      }
    },
    "totalFound": {
      "type": "number"
    },
    "pageCount": {
      "type": "number"
    },
    "truncated": {
      "type": "boolean"
    },
    "cursor": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "query": {
      "type": "string"
    },
    "appliedFilters": {
      "type": "object",
      "properties": {
        "fileType": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "string"
            }
          ]
        },
        "sizeMin": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "string"
            }
          ]
        },
        "sizeMax": {
          "type": "null"
        },
        "dateFrom": {
          "type": "null"
        },
        "dateTo": {
          "type": "null"
        },
        "durationMin": {
          "type": "null"
        },
        "durationMax": {
          "type": "null"
        },
        "sortBy": {
          "type": "string"
        },
        "sortOrder": {
          "type": "string"
        },
        "limit": {
          "type": "number"
        }
      }
    }
  }
}

Worked examples

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Replace synthetic identifiers through credential-scoped discovery. Refused scenarios document failure boundaries; they are not successful workflows.

Successful request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "search": ""
}

CLI:

topolo actions validate app_topolo_bytes.files.search --data @payload.json --json
topolo actions plan app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.files.search",
    "input": {
      "search": ""
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "files": [],
  "totalFound": 0,
  "pageCount": 0,
  "truncated": false,
  "cursor": null,
  "query": "",
  "appliedFilters": {}
}

HTTP 200. Follow cursor when truncated; inspect query and appliedFilters. An empty result does not prove a file is absent from every page or that semantic indexing is configured.

Another supported request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "fileType": "images",
  "search": "holiday"
}

CLI:

topolo actions validate app_topolo_bytes.files.search --data @payload.json --json
topolo actions plan app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.files.search",
    "input": {
      "fileType": "images",
      "search": "holiday"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "files": [
    {
      "key": "holiday.png",
      "size": 1,
      "uploaded": "2026-10-04T01:57:56.440Z",
      "url": "/download/holiday.png?bucket=topolo-bytes-test&scope=org",
      "type": "image",
      "folder": "",
      "filename": "holiday.png",
      "thumb": "https://bytes-api.test.local/api/signed-download?data=%7B%22key%22%3A%22organizations%2Forg_acme%2Fworkspaces%2Fworkspace_acme%2Fholiday.png%22%2C%22expiresAt%22%3A%222026-10-04T02%3A57%3A56.441Z%22%2C%22downloadFilename%22%3A%22holiday.png%22%7D&sig=ccdb481e95d7adc65be4fe63114c958ee3a8e17b9fbdde2b3d313af5104742ba",
      "relevanceScore": 90
    }
  ],
  "totalFound": 1,
  "pageCount": 1,
  "truncated": false,
  "cursor": null,
  "query": "holiday",
  "appliedFilters": {
    "fileType": "images",
    "sizeMin": null,
    "sizeMax": null,
    "dateFrom": null,
    "dateTo": null,
    "durationMin": null,
    "durationMax": null,
    "sortBy": "relevance",
    "sortOrder": "desc",
    "limit": 50
  }
}

HTTP 200. Follow cursor when truncated; inspect query and appliedFilters. An empty result does not prove a file is absent from every page or that semantic indexing is configured.

Another supported request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "sizeMin": "1000",
  "search": "doc"
}

CLI:

topolo actions validate app_topolo_bytes.files.search --data @payload.json --json
topolo actions plan app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.files.search",
    "input": {
      "sizeMin": "1000",
      "search": "doc"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "files": [
    {
      "key": "big-doc.txt",
      "size": 5000,
      "uploaded": "2026-10-04T01:57:56.443Z",
      "url": "/download/big-doc.txt?bucket=topolo-bytes-test&scope=org",
      "type": "text",
      "folder": "",
      "filename": "big-doc.txt",
      "thumb": "https://bytes-api.test.local/api/signed-download?data=%7B%22key%22%3A%22organizations%2Forg_acme%2Fworkspaces%2Fworkspace_acme%2Fbig-doc.txt.thumb.v3.svg%22%2C%22expiresAt%22%3A%222026-10-04T04%3A57%3A56.446Z%22%2C%22downloadFilename%22%3A%22big-doc.txt.svg%22%7D&sig=3dbac189d2ae8a8280c2b5274629bbb58bc15a3f28dda87d3f27b325a519c137",
      "relevanceScore": 40
    }
  ],
  "totalFound": 1,
  "pageCount": 1,
  "truncated": false,
  "cursor": null,
  "query": "doc",
  "appliedFilters": {
    "fileType": null,
    "sizeMin": "1000",
    "sizeMax": null,
    "dateFrom": null,
    "dateTo": null,
    "durationMin": null,
    "durationMax": null,
    "sortBy": "relevance",
    "sortOrder": "desc",
    "limit": 50
  }
}

HTTP 200. Follow cursor when truncated; inspect query and appliedFilters. An empty result does not prove a file is absent from every page or that semantic indexing is configured.

Refused request · HTTP 403

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "search": "x",
  "scope": "private"
}

CLI:

topolo actions validate app_topolo_bytes.files.search --data @payload.json --json
topolo actions plan app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 403:

{
  "error": "Forbidden",
  "message": "You do not have access to this search scope"
}

HTTP 403. This request was refused; preserve the exact response and correct its cause before retrying.

Refused request · HTTP 401

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "search": "foo"
}

CLI:

topolo actions validate app_topolo_bytes.files.search --data @payload.json --json
topolo actions plan app_topolo_bytes.files.search --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 401:

{
  "error": "Unauthorized",
  "message": "No token"
}

HTTP 401. This request was refused; preserve the exact response and correct its cause before retrying.

Verify the result

  • Follow cursor when truncated; inspect query and appliedFilters. An empty result does not prove a file is absent from every page or that semantic indexing is configured.

Errors and recovery

  • Forbidden (HTTP 403): Verify the pinned organization, granted workspace resource and required application permission. Inspect the exact refusal before requesting narrower access; never switch scope to bypass the denial.
  • Unauthorized (HTTP 401): Refresh the authorized credential in the same environment and organization. A failed authentication is not a successful handler effect.

Authentication, the action-input validator or resource middleware can refuse a request before this handler. Preserve the exact request id, error and selected credential context. The fixtures establish no live credentials or configured provider.

Recovery boundary

No atomic rollback exists for generated thumbnails or semantic backfill. Original content is not replaced by this action.

  • List files: List one page of files and directories in the verified workspace; eligible files can have derived thumbnails generated during listing.

Evidence

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Capture digests and test scenarios are retained in the source fixture records.