Coral Create Source Spec
Use this skill when the task is to author or repair a Coral source spec.
Goal
Produce a valid, queryable Coral source spec that works with:
coral source lint <path>
coral source add --file <path>
coral source test <name>
coral sql
coral.tables and coral.columns
coral.inputs for source variables and secrets
Default Mode
Default to standalone source authoring for external developers.
That means:
- create a YAML source spec file
- lint it early with
coral source lint <path>
- add it to Coral with
coral source add --file <path> when you need to exercise it as a source
- validate by querying it
- iterate until the shape is correct
Only switch to Coral repo layout when the user is explicitly editing the Coral repo.
Output Modes
- External authoring:
- create a standalone source spec such as
./my-source.yaml
- validate structure with
coral source lint ./my-source.yaml
- load it with
coral source add --file ./my-source.yaml when you need to query it through Coral
- Coral repo contribution:
- write community source specs to
sources/community/<name>/manifest.yaml
- write core source specs to
sources/core/<name>/manifest.yaml only when the user is intentionally changing bundled core sources
- add representative
test_queries for a basic smoke/connection check of the source
- validate with
coral source test <name> and repo checks
Workflow
- Read the provider API docs or inspect the local dataset.
- Start with one small table and a few columns.
- Define:
- source metadata
- backend
- base URL or file location
- auth
- variables and secrets
- credential retrieval methods for secrets, including OAuth when the provider supports browser-based setup
- if authoring a separate
kind: identity manifest, identity setup inputs and OAuth method config
- tables
- table functions for source-scoped parameterized endpoints
- filters
- response extraction
- pagination
- typed columns
- Lint the source spec:
- Validate the source in the right mode:
- standalone specs:
coral source add --file <path> and inspect with coral sql
coral source add is non-interactive by default: each input key is read from the matching environment variable. Export required variables and secrets before running, or pass --interactive to be prompted.
- for OAuth credential methods, run
coral source add --interactive --file <path> with no environment value for the target secret so Coral offers the authored credential choices
- repo sources or already-named sources:
coral source test <name>
- Inspect the exposed shape:
- inspect
coral.tables for visible tables, descriptions, guides, and required filters; keep metadata queries bounded with LIMIT/OFFSET
- inspect
coral.table_functions for source-scoped functions, descriptions, guides, arguments, result columns, kind, and search limits
- inspect
coral.columns for canonical column metadata, including is_virtual and is_required_filter; filter by one table or page large column sets
- inspect
coral.filters for normalized table filter names, types, modes, required flags, and descriptions
- inspect
coral.inputs to verify variables, secrets, defaults, hints, and required flags
- Query representative tables with
coral sql.
- If you are relying on
coral source test, make sure test_queries gives you a basic smoke/connection check for the source.
- Refine the spec and repeat.
Authoring Rules
- Start small and expand table coverage incrementally.
- Use the source manifest schema as both inspiration for authoring and validation of structure: https://github.com/withcoral/coral/blob/main/crates/coral-spec/src/schema/source_manifest.schema.json
- Use source variables for non-secret configuration.
- Use source secrets for credentials.
- For OAuth-backed services, model setup with
inputs.<TOKEN>.credential.methods[] using type: oauth; keep the runtime auth or request header pointing at the same secret input.
- OAuth credential methods support device-code, authorization-code, and client-credentials flow. For authorization-code flow, set
flow.type: authorization_code, set flow.pkce explicitly to required or disabled, use a loopback http://127.0.0.1 or http://localhost redirect URI, choose redirect_uri_port_mode: random for provider apps or Dynamic Client Registration endpoints that allow variable localhost ports, and choose fixed only when users can register the exact non-zero redirect URI. The CLI also accepts the final loopback redirect URL pasted into the terminal when the browser cannot reach the machine running Coral, so do not reject authorization-code OAuth solely because users may run Coral over SSH, in a VM, or in another split-browser environment. For device-code flow, declare flow.type: device_code, endpoints.device_authorization_url, endpoints.token_url, and either a public client ID or client.dynamic_registration; omit redirect URI fields and do not declare a static client secret. For client-credentials flow, declare flow.type: client_credentials, endpoints.token_url, client.id.input, client.secret.input, and client.secret.transport; omit redirect URI fields, authorization endpoints, device authorization endpoints, PKCE, and Dynamic Client Registration.
- When an authorization-code or device-code provider supports OAuth Dynamic Client Registration, prefer
client.dynamic_registration.registration_url over hard-coding a shared public client ID. Coral always registers a native client; source specs cannot configure a web Dynamic Client Registration application type. Set token_endpoint_auth_method to none, client_secret_basic, or client_secret_post to match the registered client type. Set request_refresh_token_grant: true only when the provider supports registering clients for refresh-token grants. For OAuth-protected Streamable HTTP MCP servers, set oauth.resource to the MCP server URL when the provider requires resource indicators.
- OAuth URL fields may template declared
kind: variable inputs with {{input.KEY}} for non-secret endpoint components such as tenant IDs or domains. This includes endpoints.*, resource, and client.dynamic_registration.registration_url. Do not reference secret inputs, filters, function arguments, state, or inline defaults from OAuth URLs.
- If a provider also supports manually pasted tokens, include a
type: source_config fallback after the OAuth method. When the provider's token endpoint requires client authentication with a client secret, prompt for both OAuth client values: declare client.id.input, client.secret.input, and client.secret.transport (basic_auth or request_body).
- Do not add top-level source inputs solely for OAuth client credentials;
client.id.input and client.secret.input are collected during OAuth setup.
- In a
kind: identity manifest, put provider issuer, identity type, setup inputs, OAuth URLs, client IDs, and client secrets on the identity spec itself. Identity OAuth client.id may use default, a variable input, or both; client.secret.input must reference a declared secret input. OAuth URL templates may reference only declared variable inputs. Identity inputs must not declare source credential methods.
- Each credential method accepts optional
label, description, and hint fields, surfaced during interactive install and in the generated source docs. When an input offers more than one method, put the how-to-get-it guidance in each method's hint (rendered next to that method's fields) instead of in one long input-level hint, and scope each hint to the inputs that method collects.
- For short-lived OAuth access tokens, make sure authorization-code or device-code methods can obtain refresh tokens when the provider supports them, and document any scopes, consent prompts, or client settings required for refresh-token issuance. Client-credentials methods re-mint access tokens from stored client metadata when the provider returns usable
expires_in metadata; without it, users must reconnect after the token expires. If another OAuth method will not issue refresh tokens, call out that users must reconnect when access tokens expire unless the source has another supported long-lived credential path.
- Keep table and table-function names stable, SQL-friendly, and unique within
the source's case-insensitive relation namespace. Prefer plain
snake_case
table names. Table-function names must start with an ASCII letter or
underscore and then use only ASCII letters, numbers, or underscores.
- Mark filters as required only when the API truly requires them.
- Use default table functions for parameterized non-retrieval operations, such as scoped child collections, time-range logs, metrics queries, or detail operations that do not map cleanly to a stable table.
- Use
kind: search table functions for provider endpoints that accept query text and return ranked candidates.
- Set a table-function arg
type when the provider argument is not string-shaped; omitted arg types default to Utf8.
- Do not model provider search as a table filter. Use
mode: contains only for ordinary provider-side substring filters. Provider-ranked retrieval belongs in a kind: search function.
- Include
search_limits on every kind: search function and expose stable result identifiers for follow-up detail queries.
- Prefer explicit pagination when the API shape is known.
- Verify pagination with actual row fetches, not only
COUNT(*).
- Add or update
test_queries when you want coral source test to perform a basic smoke/connection check.
Metadata UX Rules
Use these rules for top-level source metadata so source discovery and setup are consistent.
description
- Start with
Query ....
- Make the first sentence capability-first: list the key entities users can query.
- Preferred template:
Query <entities> from <Provider> (<Cloud or self-hosted when relevant>).
- Keep
description focused on data coverage, not setup steps.
- Do not use vague phrasing such as:
REST API v3
OpenAPI provider
... and more
- Move auth/setup/permission details to input hints, not description text.
Input hints (inputs.<KEY>.hint)
Each hint should tell the user:
- what value is expected
- how to obtain it
- minimum scope/permission guidance
- one concrete format/example when useful
Specific guidance:
- For URL/base inputs:
- say what the default means
- include at least one concrete example
- include self-hosted guidance when supported
- For secrets:
- name the exact credential type (API key, PAT, application key, etc.)
- include format constraints when relevant (for example, token prefixes)
- include least-privilege scope guidance
- For OAuth methods:
- use a user-facing
label such as Connect with GitHub
- keep
description to a short one-line blurb; put the setup detail in the method's hint
- in the method's
hint, list the required OAuth scopes and explain whether users must register a fixed loopback redirect URI or provide their own OAuth client ID/secret; when the method collects client.id.input/client.secret.input, say where to obtain those values
- for authorization-code flow, note in the method's
hint that users can paste the final localhost redirect URL into the terminal if their browser cannot reach Coral's loopback listener directly
- when a secret offers multiple methods, scope each method's
hint to the inputs that method collects instead of writing one broad input-level hint that mixes guidance for every method
- For derived secrets (for example Basic auth blobs):
- include a short shell example (for example a Base64 command)
- Prefer stable documentation links.
- Use official docs links and stable settings pages.
- Avoid brittle click-path instructions as the primary guidance.
Keep hints concise and directly actionable.
Validation Loop
Use this loop during authoring:
# Export any required inputs first (key matches the input `key` in the spec),
# or pass --interactive to be prompted.
coral source lint ./my-source.yaml
coral source add --file ./my-source.yaml
coral source test my_source
coral sql "SELECT catalog_name, schema_name, table_name, description, required_filters FROM coral.tables WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY catalog_name, schema_name, table_name LIMIT 50 OFFSET 0"
coral sql "SELECT function_name, kind, arguments_json, result_columns_json, search_limits_json FROM coral.table_functions WHERE schema_name = 'my_source' ORDER BY function_name LIMIT 50 OFFSET 0"
coral sql "SELECT table_name, filter_name, filter_mode, is_required, data_type, description FROM coral.filters WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY table_name, filter_name LIMIT 100 OFFSET 0"
coral sql "SELECT table_name, column_name, data_type, is_virtual, is_required_filter, filter_mode, description FROM coral.columns WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY table_name, ordinal_position LIMIT 100 OFFSET 0"
coral sql "SELECT catalog_name, key, kind, value, default_value, hint, required, is_set FROM coral.inputs WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY key"
Each WHERE clause matches on both qualifiers because a source is addressed
either by schema or by catalog. Schema-addressed sources carry the source name in
schema_name and leave catalog_name empty; database sources put the source name
in catalog_name, and their coral.inputs rows have an empty schema_name.
Filtering on schema_name alone returns zero rows for a database source without
reporting an error, which reads as "this source declares nothing".
For repo sources or already-named sources, add test_queries for a basic smoke/connection check and run:
coral source test my_source
Then run targeted table queries until the source behaves correctly.
HTTP Sources
For HTTP-backed sources:
- define
backend: http
- define
base_url
- define auth headers or other runtime auth fields
- define
credential.methods on secret inputs when setup should offer OAuth or another retrieval choice
- define request path, query, and body only where needed
- define source-scoped table functions for provider-native operations that require invocation arguments
- define response
rows_path
- define pagination explicitly when the provider pattern is known
- define typed columns
- add
test_queries once you know which simple query or queries should confirm the source basically works
Read references/http-source-checklist.md when you need table-shape and pagination guidance.
If your HTTP source uses an Authorization header with a prefix (e.g. Authorization: Bearer <token>), use a secret input for the raw token and define the header with from: bearer:
inputs:
FOOBAR_API_TOKEN:
kind: secret
hint: Bearer token for the Foobar API.
auth:
type: HeaderAuth
headers:
- name: Authorization
from: bearer
key: FOOBAR_API_TOKEN
For an OAuth-backed HTTP source, add the retrieval method to that same secret input:
inputs:
FOOBAR_API_TOKEN:
kind: secret
hint: Connect with Foobar OAuth or paste a token with read access.
credential:
methods:
- type: oauth
label: Connect with Foobar
description: Open a browser and authorize Coral to read Foobar data.
hint: |
Signs you in through Foobar and requests the `read` scope. To
use your own app, set FOOBAR_OAUTH_CLIENT_ID to its Client ID.
oauth:
flow:
type: authorization_code
pkce: required
redirect_uri: http://127.0.0.1:0/oauth/callback
redirect_uri_port_mode: random
endpoints:
authorization_url: https://foobar.example.com/oauth/authorize
token_url: https://foobar.example.com/oauth/token
client:
id:
input: FOOBAR_OAUTH_CLIENT_ID
scopes:
scope:
delimiter: space
values:
- read
- type: source_config
label: Paste token
hint: Paste a Foobar API token with read access to the data you query.
auth:
type: HeaderAuth
headers:
- name: Authorization
from: bearer
key: FOOBAR_API_TOKEN
When a provider accepts either a full pasted API-key header or an OAuth access token, declare both credential inputs as optional secrets, then use from: one_of and put the complete header value first, followed by a from: bearer OAuth fallback:
inputs:
FOOBAR_API_KEY:
kind: secret
required: false
FOOBAR_OAUTH_ACCESS_TOKEN:
kind: secret
required: false
auth:
type: HeaderAuth
headers:
- name: Authorization
from: one_of
values:
- from: input
key: FOOBAR_API_KEY
- from: bearer
key: FOOBAR_OAUTH_ACCESS_TOKEN
Local Data Sources
For local file-backed sources:
- define the file backend
- define the source location
- define file selection patterns if applicable
- define typed columns
Deliverable
Report:
- source spec path
- lint / add / test commands used
- validation commands run
- assumptions made
- blocked or unverified endpoints
1---2name: coral-create-source-spec3description: Create or update a Coral source spec YAML for a custom HTTP API or local dataset. Use when authoring a standalone source for `coral source add --file`, or when adapting that spec into a Coral repo source under `sources/core` or `sources/community`.4---56# Coral Create Source Spec78Use this skill when the task is to author or repair a Coral source spec.910## Goal1112Produce a valid, queryable Coral source spec that works with:1314- `coral source lint <path>`15- `coral source add --file <path>`16- `coral source test <name>`17- `coral sql`18- `coral.tables` and `coral.columns`19- `coral.inputs` for source variables and secrets2021## Default Mode2223Default to standalone source authoring for external developers.2425That means:2627- create a YAML source spec file28- lint it early with `coral source lint <path>`29- add it to Coral with `coral source add --file <path>` when you need to exercise it as a source30- validate by querying it31- iterate until the shape is correct3233Only switch to Coral repo layout when the user is explicitly editing the Coral repo.3435## Output Modes3637- External authoring:38 - create a standalone source spec such as `./my-source.yaml`39 - validate structure with `coral source lint ./my-source.yaml`40 - load it with `coral source add --file ./my-source.yaml` when you need to query it through Coral41- Coral repo contribution:42 - write community source specs to `sources/community/<name>/manifest.yaml`43 - write core source specs to `sources/core/<name>/manifest.yaml` only when the user is intentionally changing bundled core sources44 - add representative `test_queries` for a basic smoke/connection check of the source45 - validate with `coral source test <name>` and repo checks4647## Workflow48491. Read the provider API docs or inspect the local dataset.502. Start with one small table and a few columns.513. Define:52 - source metadata53 - backend54 - base URL or file location55 - auth56 - variables and secrets57 - credential retrieval methods for secrets, including OAuth when the provider supports browser-based setup58 - if authoring a separate `kind: identity` manifest, identity setup inputs and OAuth method config59 - tables60 - table functions for source-scoped parameterized endpoints61 - filters62 - response extraction63 - pagination64 - typed columns654. Lint the source spec:66 - `coral source lint <path>`675. Validate the source in the right mode:68 - standalone specs: `coral source add --file <path>` and inspect with `coral sql`69 - `coral source add` is non-interactive by default: each input `key` is read from the matching environment variable. Export required variables and secrets before running, or pass `--interactive` to be prompted.70 - for OAuth credential methods, run `coral source add --interactive --file <path>` with no environment value for the target secret so Coral offers the authored credential choices71 - repo sources or already-named sources: `coral source test <name>`726. Inspect the exposed shape:73 - inspect `coral.tables` for visible tables, descriptions, guides, and required filters; keep metadata queries bounded with `LIMIT`/`OFFSET`74 - inspect `coral.table_functions` for source-scoped functions, descriptions, guides, arguments, result columns, kind, and search limits75 - inspect `coral.columns` for canonical column metadata, including `is_virtual` and `is_required_filter`; filter by one table or page large column sets76 - inspect `coral.filters` for normalized table filter names, types, modes, required flags, and descriptions77 - inspect `coral.inputs` to verify variables, secrets, defaults, hints, and required flags787. Query representative tables with `coral sql`.798. If you are relying on `coral source test`, make sure `test_queries` gives you a basic smoke/connection check for the source.809. Refine the spec and repeat.8182## Authoring Rules8384- Start small and expand table coverage incrementally.85- Use the source manifest schema as both inspiration for authoring and validation of structure: https://github.com/withcoral/coral/blob/main/crates/coral-spec/src/schema/source_manifest.schema.json86- Use source variables for non-secret configuration.87- Use source secrets for credentials.88- For OAuth-backed services, model setup with `inputs.<TOKEN>.credential.methods[]` using `type: oauth`; keep the runtime `auth` or request header pointing at the same secret input.89- OAuth credential methods support device-code, authorization-code, and client-credentials flow. For authorization-code flow, set `flow.type: authorization_code`, set `flow.pkce` explicitly to `required` or `disabled`, use a loopback `http://127.0.0.1` or `http://localhost` redirect URI, choose `redirect_uri_port_mode: random` for provider apps or Dynamic Client Registration endpoints that allow variable localhost ports, and choose `fixed` only when users can register the exact non-zero redirect URI. The CLI also accepts the final loopback redirect URL pasted into the terminal when the browser cannot reach the machine running Coral, so do not reject authorization-code OAuth solely because users may run Coral over SSH, in a VM, or in another split-browser environment. For device-code flow, declare `flow.type: device_code`, `endpoints.device_authorization_url`, `endpoints.token_url`, and either a public client ID or `client.dynamic_registration`; omit redirect URI fields and do not declare a static client secret. For client-credentials flow, declare `flow.type: client_credentials`, `endpoints.token_url`, `client.id.input`, `client.secret.input`, and `client.secret.transport`; omit redirect URI fields, authorization endpoints, device authorization endpoints, PKCE, and Dynamic Client Registration.90- When an authorization-code or device-code provider supports OAuth Dynamic Client Registration, prefer `client.dynamic_registration.registration_url` over hard-coding a shared public client ID. Coral always registers a native client; source specs cannot configure a `web` Dynamic Client Registration application type. Set `token_endpoint_auth_method` to `none`, `client_secret_basic`, or `client_secret_post` to match the registered client type. Set `request_refresh_token_grant: true` only when the provider supports registering clients for refresh-token grants. For OAuth-protected Streamable HTTP MCP servers, set `oauth.resource` to the MCP server URL when the provider requires resource indicators.91- OAuth URL fields may template declared `kind: variable` inputs with `{{input.KEY}}` for non-secret endpoint components such as tenant IDs or domains. This includes `endpoints.*`, `resource`, and `client.dynamic_registration.registration_url`. Do not reference secret inputs, filters, function arguments, state, or inline defaults from OAuth URLs.92- If a provider also supports manually pasted tokens, include a `type: source_config` fallback after the OAuth method. When the provider's token endpoint requires client authentication with a client secret, prompt for both OAuth client values: declare `client.id.input`, `client.secret.input`, and `client.secret.transport` (`basic_auth` or `request_body`).93- Do not add top-level source inputs solely for OAuth client credentials; `client.id.input` and `client.secret.input` are collected during OAuth setup.94- In a `kind: identity` manifest, put provider `issuer`, identity `type`, setup inputs, OAuth URLs, client IDs, and client secrets on the identity spec itself. Identity OAuth `client.id` may use `default`, a variable `input`, or both; `client.secret.input` must reference a declared secret input. OAuth URL templates may reference only declared variable inputs. Identity inputs must not declare source credential methods.95- Each credential method accepts optional `label`, `description`, and `hint` fields, surfaced during interactive install and in the generated source docs. When an input offers more than one method, put the how-to-get-it guidance in each method's `hint` (rendered next to that method's fields) instead of in one long input-level `hint`, and scope each hint to the inputs that method collects.96- For short-lived OAuth access tokens, make sure authorization-code or device-code methods can obtain refresh tokens when the provider supports them, and document any scopes, consent prompts, or client settings required for refresh-token issuance. Client-credentials methods re-mint access tokens from stored client metadata when the provider returns usable `expires_in` metadata; without it, users must reconnect after the token expires. If another OAuth method will not issue refresh tokens, call out that users must reconnect when access tokens expire unless the source has another supported long-lived credential path.97- Keep table and table-function names stable, SQL-friendly, and unique within98 the source's case-insensitive relation namespace. Prefer plain `snake_case`99 table names. Table-function names must start with an ASCII letter or100 underscore and then use only ASCII letters, numbers, or underscores.101- Mark filters as required only when the API truly requires them.102- Use default table functions for parameterized non-retrieval operations, such as scoped child collections, time-range logs, metrics queries, or detail operations that do not map cleanly to a stable table.103- Use `kind: search` table functions for provider endpoints that accept query text and return ranked candidates.104- Set a table-function arg `type` when the provider argument is not string-shaped; omitted arg types default to `Utf8`.105- Do not model provider search as a table filter. Use `mode: contains` only for ordinary provider-side substring filters. Provider-ranked retrieval belongs in a `kind: search` function.106- Include `search_limits` on every `kind: search` function and expose stable result identifiers for follow-up detail queries.107- Prefer explicit pagination when the API shape is known.108- Verify pagination with actual row fetches, not only `COUNT(*)`.109- Add or update `test_queries` when you want `coral source test` to perform a basic smoke/connection check.110111## Metadata UX Rules112113Use these rules for top-level source metadata so source discovery and setup are consistent.114115### `description`116117- Start with `Query ...`.118- Make the first sentence capability-first: list the key entities users can query.119- Preferred template:120 - `Query <entities> from <Provider> (<Cloud or self-hosted when relevant>).`121- Keep `description` focused on data coverage, not setup steps.122- Do not use vague phrasing such as:123 - `REST API v3`124 - `OpenAPI provider`125 - `... and more`126- Move auth/setup/permission details to input hints, not description text.127128### Input hints (`inputs.<KEY>.hint`)129130Each hint should tell the user:131132- what value is expected133- how to obtain it134- minimum scope/permission guidance135- one concrete format/example when useful136137Specific guidance:138139- For URL/base inputs:140 - say what the default means141 - include at least one concrete example142 - include self-hosted guidance when supported143- For secrets:144 - name the exact credential type (API key, PAT, application key, etc.)145 - include format constraints when relevant (for example, token prefixes)146 - include least-privilege scope guidance147- For OAuth methods:148 - use a user-facing `label` such as `Connect with GitHub`149 - keep `description` to a short one-line blurb; put the setup detail in the method's `hint`150 - in the method's `hint`, list the required OAuth scopes and explain whether users must register a fixed loopback redirect URI or provide their own OAuth client ID/secret; when the method collects `client.id.input`/`client.secret.input`, say where to obtain those values151 - for authorization-code flow, note in the method's `hint` that users can paste the final localhost redirect URL into the terminal if their browser cannot reach Coral's loopback listener directly152 - when a secret offers multiple methods, scope each method's `hint` to the inputs that method collects instead of writing one broad input-level hint that mixes guidance for every method153- For derived secrets (for example Basic auth blobs):154 - include a short shell example (for example a Base64 command)155- Prefer stable documentation links.156 - Use official docs links and stable settings pages.157 - Avoid brittle click-path instructions as the primary guidance.158159Keep hints concise and directly actionable.160161## Validation Loop162163Use this loop during authoring:164165```sh166# Export any required inputs first (key matches the input `key` in the spec),167# or pass --interactive to be prompted.168coral source lint ./my-source.yaml169coral source add --file ./my-source.yaml170coral source test my_source171coral sql "SELECT catalog_name, schema_name, table_name, description, required_filters FROM coral.tables WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY catalog_name, schema_name, table_name LIMIT 50 OFFSET 0"172coral sql "SELECT function_name, kind, arguments_json, result_columns_json, search_limits_json FROM coral.table_functions WHERE schema_name = 'my_source' ORDER BY function_name LIMIT 50 OFFSET 0"173coral sql "SELECT table_name, filter_name, filter_mode, is_required, data_type, description FROM coral.filters WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY table_name, filter_name LIMIT 100 OFFSET 0"174coral sql "SELECT table_name, column_name, data_type, is_virtual, is_required_filter, filter_mode, description FROM coral.columns WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY table_name, ordinal_position LIMIT 100 OFFSET 0"175coral sql "SELECT catalog_name, key, kind, value, default_value, hint, required, is_set FROM coral.inputs WHERE schema_name = 'my_source' OR catalog_name = 'my_source' ORDER BY key"176```177178Each `WHERE` clause matches on both qualifiers because a source is addressed179either by schema or by catalog. Schema-addressed sources carry the source name in180`schema_name` and leave `catalog_name` empty; database sources put the source name181in `catalog_name`, and their `coral.inputs` rows have an empty `schema_name`.182Filtering on `schema_name` alone returns zero rows for a database source without183reporting an error, which reads as "this source declares nothing".184185For repo sources or already-named sources, add `test_queries` for a basic smoke/connection check and run:186187```sh188coral source test my_source189```190191Then run targeted table queries until the source behaves correctly.192193## HTTP Sources194195For HTTP-backed sources:196197- define `backend: http`198- define `base_url`199- define auth headers or other runtime auth fields200- define `credential.methods` on secret inputs when setup should offer OAuth or another retrieval choice201- define request path, query, and body only where needed202- define source-scoped table functions for provider-native operations that require invocation arguments203- define response `rows_path`204- define pagination explicitly when the provider pattern is known205- define typed columns206- add `test_queries` once you know which simple query or queries should confirm the source basically works207208Read `references/http-source-checklist.md` when you need table-shape and pagination guidance.209210If your HTTP source uses an Authorization header with a prefix (e.g. `Authorization: Bearer <token>`), use a secret input for the raw token and define the header with `from: bearer`:211212```yaml213inputs:214 FOOBAR_API_TOKEN:215 kind: secret216 hint: Bearer token for the Foobar API.217auth:218 type: HeaderAuth219 headers:220 - name: Authorization221 from: bearer222 key: FOOBAR_API_TOKEN223```224225For an OAuth-backed HTTP source, add the retrieval method to that same secret input:226227```yaml228inputs:229 FOOBAR_API_TOKEN:230 kind: secret231 hint: Connect with Foobar OAuth or paste a token with read access.232 credential:233 methods:234 - type: oauth235 label: Connect with Foobar236 description: Open a browser and authorize Coral to read Foobar data.237 hint: |238 Signs you in through Foobar and requests the `read` scope. To239 use your own app, set FOOBAR_OAUTH_CLIENT_ID to its Client ID.240 oauth:241 flow:242 type: authorization_code243 pkce: required244 redirect_uri: http://127.0.0.1:0/oauth/callback245 redirect_uri_port_mode: random246 endpoints:247 authorization_url: https://foobar.example.com/oauth/authorize248 token_url: https://foobar.example.com/oauth/token249 client:250 id:251 input: FOOBAR_OAUTH_CLIENT_ID252 scopes:253 scope:254 delimiter: space255 values:256 - read257 - type: source_config258 label: Paste token259 hint: Paste a Foobar API token with read access to the data you query.260auth:261 type: HeaderAuth262 headers:263 - name: Authorization264 from: bearer265 key: FOOBAR_API_TOKEN266```267268When a provider accepts either a full pasted API-key header or an OAuth access token, declare both credential inputs as optional secrets, then use `from: one_of` and put the complete header value first, followed by a `from: bearer` OAuth fallback:269270```yaml271inputs:272 FOOBAR_API_KEY:273 kind: secret274 required: false275 FOOBAR_OAUTH_ACCESS_TOKEN:276 kind: secret277 required: false278auth:279 type: HeaderAuth280 headers:281 - name: Authorization282 from: one_of283 values:284 - from: input285 key: FOOBAR_API_KEY286 - from: bearer287 key: FOOBAR_OAUTH_ACCESS_TOKEN288```289290## Local Data Sources291292For local file-backed sources:293294- define the file backend295- define the source location296- define file selection patterns if applicable297- define typed columns298299## Deliverable300301Report:302303- source spec path304- lint / add / test commands used305- validation commands run306- assumptions made307- blocked or unverified endpoints