> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erdo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GatherDatasetContextAPI mirrors the erdo_gather_dataset_context MCP tool as a
REST endpoint.




## OpenAPI

````yaml /api/openapi.json get /v1/dataset-context
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, and experiments. Authenticate with
    a Bearer API key (erdo_api_...) or scoped token (erdo_token_...).
  version: '2026-07-25'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/dataset-context:
    get:
      summary: >
        GatherDatasetContextAPI mirrors the erdo_gather_dataset_context MCP tool
        as a

        REST endpoint.
      operationId: GET:mcp.GatherDatasetContextAPI
      parameters:
        - allowEmptyValue: true
          explode: true
          in: query
          name: dataset_slugs
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - allowEmptyValue: true
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            maximum: 2147483647
            minimum: -2147483648
            type: integer
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  datasets:
                    items:
                      $ref: '#/components/schemas/types.DatasetDetailsResponse'
                    type: array
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    types.DatasetDetailsResponse:
      properties:
        dataset:
          $ref: '#/components/schemas/types.DatasetDetails'
        refresh:
          $ref: '#/components/schemas/types.RefreshSummary'
        resources:
          items:
            $ref: '#/components/schemas/types.ResourceWithAnalysis'
          type: array
        sync:
          $ref: '#/components/schemas/types.SyncInfo'
        total_resource_count:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        website_crawl:
          $ref: '#/components/schemas/types.WebsiteCrawlInfo'
      title: >
        DatasetDetailsResponse contains all information for the dataset detail
        page
      type: object
    types.DatasetDetails:
      properties:
        analysis_enabled:
          description: >
            AnalysisEnabled controls whether automatic statistical analysis runs
            for this dataset. NULL means "use default" (true), explicit false
            disables analysis.
          title: |
            Analysis settings
          type: boolean
        created_at:
          format: date-time
          type: string
        declared_schema:
          allOf:
            - $ref: '#/components/schemas/storage.DeclaredSchema'
          description: >
            datasets that have one (set on first write or declared explicitly).
            A consumer reads this instead of probing SELECT \* and
            pattern-matching column names. NULL/absent means no contract —
            schema-on-write, today's behaviour.
          title: >
            DeclaredSchema is the dataset's column contract, present only on
            table-class
        description:
          type: string
        file_type:
          title: |
            File dataset fields
          type: string
        filename:
          type: string
        id:
          format: uuid
          type: string
        instructions:
          type: string
        integration_config_key:
          type: string
        integration_id:
          format: uuid
          title: |
            Integration dataset fields
          type: string
        integration_status:
          type: string
        last_analyzed:
          format: date-time
          type: string
        name:
          type: string
        organization_id:
          format: uuid
          type: string
        slug:
          type: string
        status:
          type: string
        type:
          $ref: '#/components/schemas/types.DatasetType'
        updated_at:
          format: date-time
          type: string
        website_crawl:
          allOf:
            - $ref: '#/components/schemas/types.WebsiteCrawlInfo'
          title: |
            Website dataset fields
      title: |
        DatasetDetails contains dataset metadata for the detail page
      type: object
    types.RefreshSummary:
      description: >
        and the detail view's refresh section. Populated by GetDataset /
        GetDatasetDetails / ListDatasets when a dataset has a refresh config.
      properties:
        downstream_datasets:
          items:
            $ref: '#/components/schemas/types.DatasetDependencyRef'
          type: array
        job_id:
          format: uuid
          type: string
        last_refresh_at:
          format: date-time
          type: string
        last_refresh_duration_ms:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        last_refresh_error:
          type: string
        last_refresh_status:
          type: string
        live_write_mode:
          title: >
            Live strategy extras — present only for live_webhook /
            live_native_poll.
          type: string
        poll_interval_ms:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        refresh_mode:
          $ref: '#/components/schemas/types.RefreshMode'
        script_content:
          type: string
        strategy:
          $ref: '#/components/schemas/types.RefreshStrategy'
        transform_js:
          description: >
            script\_js / script / live\_\* strategies. Shown read-only in the
            dataset detail transform viewer.
          title: |
            TransformJS / ScriptContent are the agent-authored source for
          type: string
        upstream_datasets:
          description: >
            Upstream: datasets this one reads from (its own
            context\_dataset\_ids). Downstream: datasets that reference this one
            via their context. Resolved to slugs + names on the response so the
            frontend can render chips without a second round-trip.
          items:
            $ref: '#/components/schemas/types.DatasetDependencyRef'
          title: |
            Upstream / downstream dependencies derived from context_dataset_ids.
          type: array
        webhook_url:
          type: string
      title: >
        RefreshSummary is a lightweight view of refresh status for dataset
        listings
      type: object
    types.ResourceWithAnalysis:
      properties:
        column_stats:
          items:
            $ref: '#/components/schemas/types.ColumnStats'
          title: |
            Analysis data
          type: array
        created_at:
          format: date-time
          type: string
        description:
          type: string
        id:
          format: uuid
          type: string
        is_view:
          title: |
            Metadata flags
          type: boolean
        key:
          type: string
        last_analyzed:
          format: date-time
          type: string
        name:
          type: string
        relationships:
          items:
            $ref: '#/components/schemas/types.ResourceRelationship'
          type: array
        row_headers:
          items:
            $ref: '#/components/schemas/types.RowHeaderInfo'
          type: array
        sample_data:
          allOf:
            - $ref: '#/components/schemas/types.SampleDataPreview'
          title: |
            Sample data
        state:
          type: string
        summary:
          type: string
        type:
          type: string
        updated_at:
          format: date-time
          type: string
      title: |
        ResourceWithAnalysis contains a resource with its analysis data
      type: object
    types.SyncInfo:
      properties:
        error:
          type: string
        last_sync_at:
          format: date-time
          type: string
        next_sync_at:
          format: date-time
          type: string
        progress:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        provider_key:
          type: string
        status:
          type: string
      title: |
        SyncInfo contains sync status for integration datasets
      type: object
    types.WebsiteCrawlInfo:
      properties:
        crawl_completed_at:
          format: date-time
          type: string
        crawl_error:
          type: string
        crawl_started_at:
          format: date-time
          type: string
        crawl_status:
          type: string
        pages_discovered:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        pages_processed:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        root_url:
          type: string
      title: |
        WebsiteCrawlInfo contains crawl status for website datasets.
      type: object
    storage.DeclaredSchema:
      description: >
        jsonb on the dataset row (declared\_schema) and surfaced on the
        schema/details read endpoints.
      properties:
        columns:
          items:
            $ref: '#/components/schemas/storage.DeclaredColumn'
          type: array
      title: >
        DeclaredSchema is a table-class dataset's declared column contract,
        stored as
      type: object
    types.DatasetType:
      type: string
    types.DatasetDependencyRef:
      description: |
        for the refresh detail view's upstream/downstream lists.
      properties:
        id:
          format: uuid
          type: string
        name:
          type: string
        slug:
          type: string
      title: |
        DatasetDependencyRef is a chip-friendly reference to another dataset
      type: object
    types.RefreshMode:
      title: |
        RefreshMode controls whether a refresh replaces or upserts data.
      type: string
    types.RefreshStrategy:
      title: |
        RefreshStrategy controls how a dataset is refreshed.
      type: string
    types.ColumnStats:
      properties:
        description:
          type: string
        dtype:
          type: string
        max:
          type: number
        max_date:
          type: string
        min:
          type: number
        min_date:
          type: string
        name:
          type: string
        null_count:
          format: int64
          type: integer
        null_percent:
          type: number
        p50:
          type: number
        unique_count:
          format: int64
          type: integer
      title: |
        ColumnStats holds statistics for a single column
      type: object
    types.ResourceRelationship:
      properties:
        relationship_type:
          type: string
        target_id:
          format: uuid
          type: string
        target_name:
          type: string
        target_type:
          type: string
      title: |
        ResourceRelationship represents a relationship to another resource
      type: object
    types.RowHeaderInfo:
      properties:
        label:
          type: string
        row:
          format: int64
          type: integer
      title: |
        RowHeaderInfo holds a row header label with its 1-indexed row number
      type: object
    types.SampleDataPreview:
      properties:
        columns:
          items:
            type: string
          type: array
        row_count:
          format: int64
          type: integer
        rows:
          items:
            items:
              type: string
            type: array
          type: array
      title: |
        SampleDataPreview contains sample rows for preview
      type: object
    storage.DeclaredColumn:
      description: >
        stored contract the write path enforces and consumers read instead of
        probing. Type uses the same vocabulary as ColumnTypeOverrides
        (text|integer|float|date| boolean). Enforcement validates column NAMES
        and required-presence only: coercing or validating a CSV cell's string
        VALUE against Type is out of scope.
      properties:
        description:
          type: string
        name:
          type: string
        required:
          type: boolean
        type:
          type: string
      title: >
        DeclaredColumn is one column in a table-class dataset's declared schema
        — the
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````