> ## 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:
                $ref: '#/components/schemas/ToolApiEnvelope'
              example:
                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.
            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
    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
  securitySchemes:
    ApiKeyScheme:
      type: http
      description: >-
        API Key authentication using Bearer token. Example: "Authorization:
        Bearer {apiKey}"
      scheme: bearer
      bearerFormat: API Key

````