Query Guide
Align platform values, execute the smallest sufficient query, and explain the exact scope returned by Asklear.
agent.queryingAuthenticated runtime tools and each query response are authoritative for tenant scope and current data coverage.
- 01
query_metricsDefault route when the dataset, fields, and filter values are already known. Bundle compatible analyses in one request.
- 02
search_valuesResolve user-supplied brand, shop, and category names that are not exact IDs, standard URLs, or raw values already returned in this conversation.
- 03
describe(dataset)Recover after a field, capability, or version error. Do not use it as routine preflight.
- 04
list_datasetsUse only when the target dataset cannot be inferred from the user's question.
Rules
- Before the first business-tool call, write one concise, self-contained task_query in the user's language and reuse it verbatim for every Asklear call serving that task, including docs and recovery calls. Do not include credentials or direct personal identifiers.
- User-supplied brand, shop, and category names are inputs to align, not normalized entities. Use eq for one relevant platform raw value and in for multiple relevant values. If identity is uncertain, verify representative products instead of silently merging values.
- Treat search_values status=ambiguous or requires_clarification=true as a stop condition. Ask the user which candidate they mean; if the ambiguity is only discovered after querying, disclose the exact raw value used.
- Keep requested scope, resolved scope, entitled scope, and data watermark distinct. Never silently crop, substitute, zero-fill, or omit unavailable periods. data_range_unavailable is a range error, not a 503 capability failure.
- Compare results only after checking platform, time, filters, metrics, and group_by. A cross-dataset comparison uses a separate query_metrics call for each dataset, reports each resolved month, and never assumes a shared watermark.
- group_by is the result grain. A Top N product list is a sample, not the full market, and an ASP change does not by itself prove same-product price movement.
- Distinguish server metrics, Agent calculations, and Agent judgments. Verify important or counter-intuitive conclusions with product- or SKU-level evidence when the capability is available.
Tool boundaries
query_metrics
Aggregate supported metrics and dimensions.
- Query only what is needed; place shared scope in common_filters and compatible analyses in additional_queries.
- Treat meta.resolved_query as the executed scope and meta.truncated as the completeness signal.
- Use meta.scope_summary as the concise user-visible projection of that executed scope.
search_values
Align searchable platform values before filtering.
- Use field=category when the category level is unknown, then use the concrete field returned by the match.
- Do not repeat discovery for exact IDs, standard URLs, or raw values already returned in the current conversation.
- Stop for clarification when status is ambiguous or requires_clarification is true; never silently merge candidates.
docs
Search or read the same documentation published on the web.
- Use the page index first when the required document ID is unknown.
get_pricing
Explain current pricing rules, not a request-specific estimate.
- Use the response as one versioned pricing snapshot.
list_datasets
Use only when the target dataset cannot be inferred.
- Select only a dataset returned by the authenticated call.
describe
Recover after a contract or capability error.
- Treat authenticated fields, limits, time range, and certification as runtime truth.
query_details
Drill into raw product fields, including title-keyword research, only when tools/list exposes it.
- Use an explicit brand, shop, category, product reference, or other supported narrow scope.
export
Create a file only when the user explicitly requests one and tools/list exposes export.
- Follow server-provided format, expiry, access, and credit limits.
Time and scope
- For latest/current use time.last_complete_months=1 separately for each dataset; for recent N complete months use N.
- Send an explicit shared range unchanged to each dataset and report each dataset's actual resolved range and data_through.
Interpretation and validation
- Do not infer full-market conclusions from a truncated or Top N result.
- Explain metric definitions and separate composition changes from same-item changes.
Cost and recovery
- approval_required returns a maximum charge; actual debit is charged_credits after execution.
- Prefer aggregation and drill into product details only when necessary. Failed requests are not charged; do not loop on the same error.
- For query_too_broad narrow time, filters, fields, or result grain; for unknown_field read supported fields; for data_range_unavailable explain requested and available ranges.
User-visible query scope
- State dataset and platform, resolved time and watermark, aligned raw values, metric definitions, filters, group_by, and whether results are complete or Top N.
- Call out missing data, ambiguity, limitations, and any scope change; do not narrate routine internal tool calls.
Output policy
- Lead with the business conclusion in the user's language.
- State the dataset and platform, resolved time and data watermark, aligned raw values, metric definitions, filters, group_by, and whether the result is complete or Top N.
- Distinguish server metrics, Agent calculations, and Agent judgments.
- Explain relevant missing data, ambiguity, limitations, approvals, or scope changes without narrating routine tool calls.
Optional capabilities
list_datasets
- Absence from tools/list means unavailable.
describe
- Use for recovery, not routine preflight.
query_details
- Use only when the authenticated tool surface exposes it.
export
- Use only for an explicitly requested file.
Call examples
Professional data
Replace the example category with the exact raw value returned by search_values.
search_values{
"dataset": "jd",
"field": "category_l3",
"kw": "示例品类",
"limit": 10,
"task_query": "分析京东某品类最近一个完整月的品牌销售额排名"
}query_metrics{
"dataset": "jd",
"filters": [
{
"field": "category_l3",
"op": "eq",
"value": "示例品类"
}
],
"group_by": [
"brand"
],
"limit": 10,
"metrics": [
"gmv"
],
"order_by": [
{
"dir": "desc",
"field": "gmv"
}
],
"task_query": "分析京东某品类最近一个完整月的品牌销售额排名",
"time": {
"last_complete_months": 1
}
}Public webpage
Estimate first; use the returned quote_token and upper_bound_credits only after user approval.
estimate_collection{
"input": {
"output_format": "markdown",
"urls": [
"https://example.com/"
]
},
"task_code": "raw_html_v1",
"task_query": "获取示例网页内容并用于当前研究任务"
}start_collection{
"idempotency_key": "web-research-1",
"input": {
"output_format": "markdown",
"urls": [
"https://example.com/"
]
},
"max_credits": 2,
"quote_token": "<estimate_collection 返回的 quote_token>",
"task_code": "raw_html_v1",
"task_query": "获取示例网页内容并用于当前研究任务"
}get_collection_job{
"job_id": "<start_collection 返回的 job_id>",
"task_query": "获取示例网页内容并用于当前研究任务"
}Asynchronous collection
Retrieve fresh public information through an estimated, approved, and traceable asynchronous task.
Use collection only when its operations appear in the current tools/list response.
Workflow
- 01
list_collection_tasksDiscover the task code and current entitlement.
- 02
estimate_collectionEstimate the task and show upper_bound_credits plus the expected duration to the user.
- 03
start_collectionAfter explicit approval, start with the estimate values and a new idempotency_key.
- 04
get_collection_jobPoll only after poll_after_seconds and stop at succeeded or failed.
Billing, retries, and recovery
- upper_bound_credits is a safety ceiling; a successful task settles the actual amount within that ceiling.
- A failed task releases the user's Credits reservation and does not settle a user charge.
- Reuse an idempotency_key only for the same task; an intentionally new task requires a new key.
- For collection_external_unknown, the user's Credits were not settled but the provider-side fee is unknown; do not retry automatically and ask the user to decide.
- Resolve a terminal error_code with page=agent.error.<error_code>; fall back to page=agent.errors when absent.
- Runtime tools/list is authoritative for collection access.