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

# List visible data sources

> Lists the repositories and workspaces visible to the calling API key, including readiness state. Call this first: every other tool accepts the returned `name` values in its `data_sources`/`data_source` argument (use `id` only for automation or to disambiguate duplicate names). Pass an optional `query` to rank sources by relevance to a question; the call is billed only when relevance ranking actually runs.



## OpenAPI

````yaml /openapi-tool-api-v3.json post /api/tools/get_data_sources
openapi: 3.1.1
info:
  title: CodeAlive Tool API
  description: >-
    Tool-only OpenAPI 3.1 contract for MCP and agent integrations. Every
    operation is read-only and returns a Tool API envelope.
  contact:
    name: CodeAlive Team
    url: https://codealive.ai
    email: support@codealive.ai
  license:
    name: Terms of Service
    url: https://app.codealive.ai/terms
  version: 3.0.0
servers:
  - url: https://app.codealive.ai
security:
  - ApiKeyScheme: []
tags:
  - name: ToolApi
    description: CodeAlive Tool API v3
paths:
  /api/tools/get_data_sources:
    post:
      tags:
        - ToolApi
      summary: List visible data sources
      description: >-
        Lists the repositories and workspaces visible to the calling API key,
        including readiness state. Call this first: every other tool accepts the
        returned `name` values in its `data_sources`/`data_source` argument (use
        `id` only for automation or to disambiguate duplicate names). Pass an
        optional `query` to rank sources by relevance to a question; the call is
        billed only when relevance ranking actually runs.
      operationId: ToolApiGetDataSources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDataSourcesToolRequest'
            example:
              query: agent framework
          text/json:
            schema:
              $ref: '#/components/schemas/GetDataSourcesToolRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/GetDataSourcesToolRequest'
      responses:
        '200':
          description: >-
            Success envelope. obj contains data_sources (visible sources with
            id, name, fullName, readiness), relevance_status (not_requested |
            skipped | failed_open | succeeded), total_available, billed, and a
            usage hint; rendered is a compact <data_sources> XML block for
            agents. Repairable failures (missing or invalid arguments, ambiguous
            or unknown data sources) also return HTTP 200 with obj.error = {
            code, message, retry, try } and a rendered <tool_error> block;
            repair the arguments and retry.
          content:
            application/json:
              schema:
                oneOf:
                  - required:
                      - obj
                      - rendered
                    type: object
                    properties:
                      obj:
                        $ref: '#/components/schemas/GetDataSourcesToolResponse'
                      rendered:
                        type: string
                        description: Agent-facing result text.
                    additionalProperties: false
                    description: >-
                      Default success projection returned when output_format is
                      omitted.
                  - required:
                      - obj
                    type: object
                    properties:
                      obj:
                        $ref: '#/components/schemas/GetDataSourcesToolResponse'
                    additionalProperties: false
                    description: >-
                      Structured success projection returned when output_format
                      is json.
                  - required:
                      - rendered
                    type: object
                    properties:
                      rendered:
                        type: string
                        description: Agent-facing result text.
                    additionalProperties: false
                    description: >-
                      Agent-facing success projection returned when
                      output_format is agentic.
                  - required:
                      - obj
                      - rendered
                    type: object
                    properties:
                      obj:
                        $ref: '#/components/schemas/ToolApiRepairableResult'
                      rendered:
                        type: string
                        description: Agent-facing result text.
                    additionalProperties: false
                    description: >-
                      Repairable failure. Always includes both projections and
                      uses HTTP 200.
              examples:
                default:
                  summary: Default success response
                  description: >-
                    Returned when output_format is omitted; includes both
                    projections.
                  value:
                    obj:
                      data_sources:
                        - type: Repository
                          id: 665f1c2ab3e77d0c9a1b4d21
                          name: agent-framework
                          fullName: CodeAlive-AI/agent-framework
                          description: Multi-agent orchestration framework.
                          readiness: Ready
                      relevance_status: succeeded
                      total_available: 3
                      billed: true
                      hint: >-
                        Use the name value returned here for
                        data_sources/data_source. Use id for automation or
                        explicit disambiguation.
                    rendered: >-
                      <data_sources relevance_status="succeeded">
                        <data_source type="Repository" id="665f1c2ab3e77d0c9a1b4d21" name="agent-framework" fullName="CodeAlive-AI/agent-framework" readiness="Ready" />
                      </data_sources>

                      Use the name attribute for data_sources/data_source unless
                      automation needs id.
                json_only:
                  summary: JSON success response
                  description: Returned when output_format is json.
                  value:
                    obj:
                      data_sources:
                        - type: Repository
                          id: 665f1c2ab3e77d0c9a1b4d21
                          name: agent-framework
                          fullName: CodeAlive-AI/agent-framework
                          description: Multi-agent orchestration framework.
                          readiness: Ready
                      relevance_status: succeeded
                      total_available: 3
                      billed: true
                      hint: >-
                        Use the name value returned here for
                        data_sources/data_source. Use id for automation or
                        explicit disambiguation.
                agentic_only:
                  summary: Agent-facing success response
                  description: Returned when output_format is agentic.
                  value:
                    rendered: >-
                      <data_sources relevance_status="succeeded">
                        <data_source type="Repository" id="665f1c2ab3e77d0c9a1b4d21" name="agent-framework" fullName="CodeAlive-AI/agent-framework" readiness="Ready" />
                      </data_sources>

                      Use the name attribute for data_sources/data_source unless
                      automation needs id.
                repairable_error:
                  summary: Repairable tool error
                  description: >-
                    Returned with HTTP 200 when arguments can be corrected and
                    retried.
                  value:
                    obj:
                      error:
                        code: unknown_argument
                        message: >-
                          Unknown JSON argument(s) are not accepted in Tool API
                          v3: search_mode.
                        retry: >-
                          yes - repair the tool arguments and call the tool
                          again
                        try: >-
                          Use only the canonical arguments documented for this
                          tool.
                    rendered: |
                      <tool_error>
                        <code>unknown_argument</code>
                        <message>Unknown JSON argument(s) are not accepted in Tool API v3: search_mode.</message>
                        <retry>yes - repair the tool arguments and call the tool again</retry>
                        <try>Use only the canonical arguments documented for this tool.</try>
                      </tool_error>
            text/json:
              schema:
                $ref: '#/components/schemas/ToolApiEnvelope'
        '400':
          description: >-
            Bad request, including malformed JSON, unknown output_format, or
            invalid transport-level input.
        '401':
          description: Authentication failed or API key is missing.
        '403':
          description: >-
            The caller is not authorized for the requested data source or plan
            feature.
        '429':
          description: Rate limit, quota, or plan limit exceeded.
        '500':
          description: Unexpected server failure.
components:
  schemas:
    GetDataSourcesToolRequest:
      type: object
      properties:
        output_format:
          enum:
            - json
            - agentic
          type:
            - 'null'
            - string
          description: >-
            Optional success projection. Omit to return both obj and rendered;
            use json for obj only; use agentic for rendered text only.
            Repairable errors always return both obj.error and rendered.
        query:
          type:
            - 'null'
            - string
          description: Optional relevance query used to rank visible data sources.
        ready_only:
          type:
            - 'null'
            - boolean
          description: When true, return only data sources ready for use. Default is true.
      additionalProperties: false
    GetDataSourcesToolResponse:
      required:
        - billed
        - data_sources
        - hint
        - relevance_status
        - total_available
      type: object
      properties:
        data_sources:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ArtifactDataSourceExtendedDto'
          description: Visible repositories and workspaces, optionally ranked by relevance.
        relevance_status:
          type:
            - 'null'
            - string
          description: >-
            Outcome of optional relevance ranking: not_requested, skipped,
            failed_open, or succeeded.
        total_available:
          type: integer
          description: Number of visible data sources before relevance filtering.
          format: int32
        billed:
          type: boolean
          description: Whether this request consumed billed relevance-ranking usage.
        hint:
          type:
            - 'null'
            - string
          description: Guidance for selecting data sources in subsequent tool calls.
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/ToolApiWarning'
          description: >-
            Compatibility warnings, such as accepted deprecated argument
            aliases.
      additionalProperties: false
      description: Result of listing data sources visible to the caller.
    ToolApiRepairableResult:
      required:
        - error
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ToolApiRepairableError'
          description: Structured error details used to repair the request and retry.
        warnings:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ToolApiWarning'
          description: Compatibility warnings emitted before the request failed.
      additionalProperties: false
      description: >-
        Repairable failure returned with HTTP 200 so an agent can correct the
        request and retry.
    ToolApiEnvelope:
      type: object
      properties:
        obj:
          description: >-
            Arbitrary JSON result for the tool. Present for omitted/json success
            projections and every repairable error.
        rendered:
          type:
            - 'null'
            - string
          description: >-
            Agent-facing result text. Present for omitted/agentic success
            projections and every repairable error.
      additionalProperties: false
    ArtifactDataSourceExtendedDto:
      required:
        - id
        - name
      type: object
      properties:
        id:
          type:
            - 'null'
            - string
          description: Stable data-source identifier.
        type:
          $ref: '#/components/schemas/ArtifactDataSourceType'
          description: Repository or Workspace.
        name:
          type:
            - 'null'
            - string
          description: Display name accepted by data_source selectors.
        fullName:
          type:
            - 'null'
            - string
          description: Owner-qualified repository name; null for workspaces.
        url:
          type:
            - 'null'
            - string
          description: Repository clone URL; null for workspaces.
        repositoryIds:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Repository ids contained by a workspace.
        branch:
          type:
            - 'null'
            - string
          description: Indexed repository branch.
        description:
          type:
            - 'null'
            - string
          description: User description or generated summary.
        readiness:
          $ref: '#/components/schemas/DataSourceReadiness'
          description: Current search and chat readiness.
        relevanceReason:
          type:
            - 'null'
            - string
          description: Why relevance ranking selected this source.
      additionalProperties: false
    ToolApiWarning:
      type: object
      properties:
        code:
          type:
            - 'null'
            - string
          description: Stable machine-readable warning code.
        message:
          type:
            - 'null'
            - string
          description: Human-readable compatibility warning.
        alias:
          type:
            - 'null'
            - string
          description: Deprecated argument alias that was accepted.
        canonical:
          type:
            - 'null'
            - string
          description: Canonical argument name to use instead of the alias.
      additionalProperties: false
    ToolApiRepairableError:
      type: object
      properties:
        code:
          type:
            - 'null'
            - string
          description: Stable machine-readable error code.
        message:
          type:
            - 'null'
            - string
          description: Human-readable explanation of the invalid request.
        retry:
          type:
            - 'null'
            - string
          description: Whether the caller should correct the request and retry.
        try:
          type:
            - 'null'
            - string
          description: Concrete guidance for repairing the next request.
      additionalProperties: false
    ArtifactDataSourceType:
      enum:
        - Repository
        - Workspace
      type: string
    DataSourceReadiness:
      enum:
        - NotReady
        - PartiallyReady
        - Ready
      type: string
  securitySchemes:
    ApiKeyScheme:
      type: http
      description: >-
        API Key authentication using Bearer token. Example: "Authorization:
        Bearer {apiKey}"
      scheme: bearer
      bearerFormat: API Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.