---
name: x402-market-intel-mcp.mtree.workers.dev
description: x402-market-intel-mcp.mtree.workers.dev provides market intelligence, trust scoring, and risk assessment for the x402 pay-per-call API ecosystem, plus pre-execution safety tooling for Solana programs and transactions. It aggregates marketplace snapshots, seller evidence, and on-chain data to help agents make informed decisions before spending or routing funds. It does not execute payments, perform swaps, or stream real-time data.
host: x402-market-intel-mcp.mtree.workers.dev
---

# x402-market-intel-mcp.mtree.workers.dev

This host serves agents operating in the x402 paid-API marketplace who need to evaluate providers, discover endpoints, assess market gaps, and audit Solana-based payment infrastructure before committing spend. It combines x402 marketplace intelligence (rankings, seller scoring, category trends, autopay readiness) with Solana-specific risk tooling (program scans, token preflights, transaction simulation). It is a decision-support layer, not an execution layer.

## When to use this host

Use this host when an agent needs to (1) evaluate x402 providers, endpoints, or resources before paying, (2) discover and rank x402 APIs for a given task, (3) understand category-level market structure and demand gaps in the x402 ecosystem, or (4) assess the safety of Solana programs, SPL tokens, or transactions before signing. Do not use this host for: executing payments or swaps (no transaction submission), real-time price feeds or streaming data (all outputs are periodic snapshots or single-shot scans), general web SEO or non-x402 marketplace ranking, or EVM/non-Solana token analysis. For live Solana RPC queries beyond risk scanning, use a dedicated Solana RPC provider. For actual x402 payment execution, use a payment-capable x402 client or wallet host.

## Capabilities

### Solana On-Chain Risk

Evaluates the safety of Solana programs, SPL tokens, and unsigned transactions before an agent signs or routes funds through them, returning verdicts, risk scores, and risk flags.

- **`scan-solana-program-risk`** — Scans a Solana program by ID and returns a trust verdict, risk score, risk flags, executable/owner/lamports status, upgradeable-loader authority hints, and known-program labels.
- **`run-solana-token-preflight`** — Performs a live SPL token preflight check on a Solana mint, returning authority/freeze/supply analysis, risk flags, a risk score, verdict, and recommended spend/trade cap.
- **`simulate-explain-solana-transaction`** — Simulates a base64-encoded Solana transaction against a live RPC node and returns logs, compute units consumed, account keys, parsed instructions, risk flags, and a sign/manual-review/avoid verdict.

### x402 Endpoint Discovery

Finds, indexes, and ranks verified x402 pay-per-call endpoints by demand, revenue, schema quality, and seller signals so agents can identify which services exist before routing a task.

- **`discover-paid-x402-apis`** — Searches and ranks verified x402 pay-per-call endpoints by buyer demand, price, schema coverage, seller score, and route reliability.
- **`fetch-verified-x402-endpoints`** — Returns a ranked directory of verified x402 pay-per-call endpoints with seller score, 30-day revenue, call volume, payer count, schema quality flags, and registry coverage.
- **`fetch-endpoint-rankings`** — Returns a ranked leaderboard of x402 paid API endpoints scored by revenue, buyer breadth, price, metadata quality, and reliability signals over the past 30 days.
- **`rank-x402-services`** — Ranks x402 API services by price, live marketplace demand, schema quality, payment behavior, seller evidence, freshness, and risk flags for a given buyer intent.

### Provider and Endpoint Trust

Audits individual x402 providers and endpoints for payment-protocol compliance, trust signals, and spend-policy safety, returning verdicts and risk flags before an agent commits payment.

- **`fetch-provider-dossier`** — Returns a trust dossier for an x402 provider including verdict, trust score, service map, pricing distribution, buyer/call evidence, registry coverage, and spend-policy signals.
- **`score-x402-seller`** — Scores an x402 seller (by wallet address, domain, or resource URL) on revenue proof, buyer breadth, metadata quality, registry coverage, and route reliability, returning a numeric score and band.
- **`check-x402-endpoint-risk`** — Audits an x402 API endpoint for payment metadata sanity, 402 behavior, schema completeness, price outliers, and replay/binding issues, returning a verdict and risk flags.
- **`fetch-x402-resource-due-diligence`** — Returns a trust and readiness report for an x402 resource URL, combining registry presence, schema/examples, seller proof, and peer category context to help an agent decide whether to autopay.

### Autopay and Spend Safety

Determines which x402 API routes are safe for autonomous spending by scoring payment envelope quality, buyer proof, price risk, and registry coverage.

- **`fetch-autopay-readiness-matrix`** — Scores x402 API routes by payment envelope quality, buyer proof, price risk, seller breadth, freshness, and registry coverage to determine autonomous-spend safety.

### Market Structure and Category Intelligence

Provides a structured view of the x402 ecosystem at the category and market level, including revenue distribution, seller concentration, payer stats, and metadata completeness across registries.

- **`fetch-x402-market-map`** — Returns a cross-source category and seller map for x402 paid APIs, including revenue, call volume, payer concentration, registry coverage, and schema-quality metrics for up to 100 resources.
- **`fetch-x402-category-trends`** — Returns a time-series trend report for x402 API categories, including demand deltas, seller concentration, revenue, metadata quality, and next-build recommendations over a configurable time window.
- **`fetch-category-gap-report`** — Returns a ranked list of x402 paid-service categories by observed demand, seller concentration, schema/example gaps, registry coverage, and freshness deltas from recurring D1 snapshots.
- **`fetch-emerging-x402-categories`** — Detects x402 market categories where buyer demand, revenue, or payer growth is high relative to supply and metadata completeness, surfacing underserved wedges.

### Buyer Intent and Demand Gap Analysis

Identifies unmet buyer demand and underserved query topics in the x402 marketplace by mining search-rank observations and marketplace snapshots, helping agents and builders prioritize what to build or source.

- **`fetch-buyer-intent-gap-report`** — Mines marketplace snapshots and search-rank observations to identify unmet buyer intent, under-indexed API routes, competitor coverage gaps, and next dataset priorities for a set of agent queries.
- **`monitor-x402-search-rank`** — Queries the x402 marketplace search-rank index for up to 20 terms, returning per-query rank snapshots including best rank, rank delta, indexed resource count, and top competing resources with pricing and usage stats.
- **`generate-proof-lift-report`** — Combines paid-call telemetry with marketplace rank observations to report route proof coverage, index/rank movement, buyer-query lift, and the next bounded proof action for x402 endpoints.

### Seller Discoverability and Keyword Visibility

Audits how a specific domain or seller ranks across x402 marketplace search queries and provides actionable copy and route recommendations to improve discoverability.

- **`fetch-keyword-visibility-pack`** — Returns paid keyword visibility insights for a domain and query set, including priority terms with scores, rank gaps, rank snapshots per query, and recommended listing copy and route actions.

## Workflows

### Safe Autopay Vendor Selection

*Use when an agent needs to autonomously select and pay an x402 API for a given task with minimal human review.*

1. **`discover-paid-x402-apis`** — Search for x402 endpoints matching the task topic or category to build a candidate list.
2. **`rank-x402-services`** — Rank the candidate endpoints by cost, demand, schema quality, and risk flags for the agent's budget and risk tolerance.
3. **`fetch-provider-dossier`** — Pull a trust dossier on the top-ranked provider to verify credibility and spend-policy signals.
4. **`check-x402-endpoint-risk`** — Audit the specific endpoint for payment-protocol compliance, price outliers, and registry presence before paying.
5. **`fetch-autopay-readiness-matrix`** — Confirm the route meets the minimum autopay readiness score before committing autonomous spend.

### x402 Resource Pre-Payment Due Diligence

*Use when an agent encounters an x402-protected resource URL and needs to decide whether to autopay it.*

1. **`fetch-x402-resource-due-diligence`** — Assess the resource's registry presence, schema quality, seller proof, and readiness score.
2. **`score-x402-seller`** — Score the seller behind the resource on revenue proof, buyer breadth, and route reliability.
3. **`check-x402-endpoint-risk`** — Audit the endpoint for payment-header sanity, 402 behavior, and replay/binding issues before paying.

### Solana Payment Route Safety Check

*Use when an agent needs to route funds through a Solana program or accept an SPL token as payment and must verify safety before signing.*

1. **`scan-solana-program-risk`** — Scan the target Solana program for risk flags, upgrade authority, and trust verdict.
2. **`run-solana-token-preflight`** — Check the SPL token mint for freeze authority, supply anomalies, and a recommended trade cap.
3. **`simulate-explain-solana-transaction`** — Simulate the unsigned transaction to confirm it will succeed and receive a sign/avoid verdict before broadcasting.

### Market Gap and Build Opportunity Discovery

*Use when an agent or developer needs to identify which x402 API categories or query topics are underserved and worth building.*

1. **`fetch-x402-market-map`** — Get a category-level overview of revenue, payer concentration, and metadata gaps across the ecosystem.
2. **`fetch-category-gap-report`** — Rank categories by observed demand versus supply thinness to surface high-opportunity gaps.
3. **`fetch-emerging-x402-categories`** — Detect newly emerging categories where buyer demand is outpacing available supply.
4. **`fetch-buyer-intent-gap-report`** — Identify specific query topics with high urgency but low API coverage to prioritize build targets.

### Seller Discoverability Audit

*Use when an agent needs to audit and improve how an x402 seller's endpoints are discovered in marketplace search.*

1. **`monitor-x402-search-rank`** — Capture current rank snapshots for the seller's target search terms and identify rank deltas.
2. **`fetch-keyword-visibility-pack`** — Audit the seller's domain across query terms, identify rank gaps, and get listing copy recommendations.
3. **`generate-proof-lift-report`** — Measure the discovery and ranking impact of paid calls and identify under-indexed endpoints to target next.

## Skill reference

### `scan-solana-program-risk`

**Solana Program Risk Scan** — Scans a Solana program by ID and returns a trust verdict, risk score, risk flags, executable/owner/lamports status, upgradeable-loader authority hints, and known-program labels.

*Use when:* Use when an agent needs to assess the security posture or trustworthiness of a Solana program before interacting with it, signing a transaction, or routing funds through it.

*Not for:* Do not use for scanning Solana token accounts or wallet addresses; this endpoint is specific to program (smart contract) IDs. Not suitable for real-time streaming risk monitoring — this is a single-shot scan.

**Inputs:**

- `program_id` (string, required) — The Solana program address (base58-encoded public key) to scan.
- `solana_rpc_url` (string) — Optional custom Solana RPC endpoint URL to use for on-chain lookups. Defaults to a provider-configured RPC if omitted.

**Returns:** Returns ok=true with a verdict string (e.g. 'known_core_program'), a numeric risk_score, and a risk_flags array listing any identified security signals.

**Example:** `{"program_id": "11111111111111111111111111111111"}`

---

### `simulate-explain-solana-transaction`

**Solana Tx Sim Explainer** — Simulates a base64-encoded Solana transaction against a live RPC node and returns logs, compute units consumed, account keys, parsed instructions, risk flags, and a sign/manual-review/avoid verdict.

*Use when:* Use when an agent needs to pre-flight a Solana transaction before signing or broadcasting — to check whether it will succeed, understand what it does, and get a safety verdict (sign, manual_review, or avoid).

*Not for:* Do not use for real-time streaming transaction monitoring or historical transaction lookup; this is a single-shot pre-execution simulation only.

**Inputs:**

- `transaction` (string, required) — Base64-serialized Solana transaction to simulate and explain.
- `solana_rpc_url` (string) — Optional Solana RPC endpoint URL to use for simulation. Defaults to a provider-configured node if omitted.
- `sig_verify` (boolean) — Whether to verify transaction signatures during simulation. Defaults to false if omitted.
- `replace_recent_blockhash` (boolean) — Whether to replace the transaction's recent blockhash with a fresh one before simulating. Useful for expired transactions.

**Returns:** Returns ok, a verdict string (sign/manual_review/avoid), a simulation object with success status and logs, and a risk_flags array listing any detected concerns.

**Example:** `{"transaction": "<base64 serialized solana transaction>", "replace_recent_blockhash": true, "sig_verify": false}`

---

### `run-solana-token-preflight`

**Solana Token Preflight** — Performs a live SPL token preflight check on a Solana mint, returning authority/freeze/supply analysis, risk flags, a risk score, verdict, and recommended spend/trade cap.

*Use when:* Use when an agent needs to evaluate a Solana mint address before trading, accepting payment in, or routing funds through an SPL token — to surface risk flags, freeze authority status, and a recommended trade cap.

*Not for:* Do not use for EVM or non-Solana tokens; use an EVM token analysis endpoint instead. Not suitable for real-time price feeds or swap execution.

**Inputs:**

- `mint` (string, required) — Solana mint address of the SPL token to preflight.
- `solana_rpc_url` (string) — Optional custom Solana RPC URL to use for on-chain lookups. Defaults to a provider-configured RPC if omitted.
- `intended_amount_usdc` (number) — Intended trade or spend amount in USDC, used to compute a recommended spend/trade cap relative to the token's liquidity profile.

**Returns:** Returns ok=true with a verdict string, integer risk_score, token object (mint + decimals), and a risk_flags array listing any authority or supply anomalies detected.

**Example:** `{"mint": "So11111111111111111111111111111111111111112", "intended_amount_usdc": 500}`

---

### `fetch-x402-resource-due-diligence`

**Resource Due Diligence** — Returns a trust and readiness report for an x402 resource URL, combining registry presence, schema/examples, seller proof, and peer category context to help an agent decide whether to autopay.

*Use when:* Use when an agent encounters an x402-protected resource and needs to assess its quality, risk, and trust signals before committing an automated payment of $0.15 USDC on Base.

*Not for:* Do not use for general URL health checks or uptime monitoring; this is specifically for evaluating x402 payment-gated resources prior to autopay decisions.

**Inputs:**

- `resource` (string, required) — URI of the x402 resource to evaluate for trust and readiness.

**Returns:** Returns ok=true, a numeric readiness_score (e.g. 82), and a warnings array listing any detected risk or quality issues.

**Example:** `{"resource": "https://example.com/v1/paid"}`

---

### `fetch-x402-category-trends`

**X402 Category Trends** — Returns a time-series trend report for x402 API categories, including demand deltas, seller concentration, revenue, metadata quality, and next-build recommendations over a configurable time window.

*Use when:* Use when an agent needs to identify which x402 API categories are gaining or losing traction, compare category-level demand and revenue shifts over a recent time window, or find underserved market gaps and recommended routes to build or buy.

*Not for:* Do not use for per-resource or per-endpoint analytics; use a resource due-diligence or endpoint-rankings endpoint instead. Not suitable for real-time streaming price feeds or individual seller scoring.

**Inputs:**

- `hours` (integer) — Look-back window in hours for trend observations. Minimum 1, maximum 168 (7 days).
- `category` (string) — Filter results to a single category slug (e.g. 'wallet-risk'). Omit to return all categories.
- `limit` (integer) — Maximum number of category trend rows to return. Minimum 1, maximum 50.

**Returns:** Returns ok=true, a generated_at timestamp, and a ranked category_trends array with trend scores, 30-day call/payer/revenue stats, window deltas, freshness bounds, underserved gap descriptions, and recommended API routes per category.

**Example:** `{"hours": 72, "limit": 10}`

---

### `score-x402-seller`

**Seller Score** — Scores an x402 seller (by wallet address, domain, or resource URL) on revenue proof, buyer breadth, metadata quality, registry coverage, and route reliability, returning a numeric score and band.

*Use when:* Use when an agent needs to evaluate the trustworthiness or market performance of an x402 seller before routing payments, selecting a data provider, or auditing a resource's commercial track record.

*Not for:* Do not use for real-time price feeds or swap quotes; this is a trust/performance scoring endpoint, not a pricing or liquidity tool.

**Inputs:**

- `pay_to` (string) — Wallet address of the x402 seller to score. At least one of pay_to, domain, or resource is required.
- `domain` (string) — Domain of the x402 seller to score. At least one of pay_to, domain, or resource is required.
- `resource` (string) — Resource path or URL of the x402 endpoint to score. At least one of pay_to, domain, or resource is required.

**Returns:** Returns ok=true with a numeric score (0–100), a band label (e.g. 'strong' or 'unproven'), an evidence object with 30-day revenue and payer counts, and a graph object with market-wide stats across all tracked x402 sellers and resources.

**Example:** `{"pay_to": "0x1664530DC2A1CA350B1dbaD1Fc1F1a70c90fe4de"}`

---

### `fetch-category-gap-report`

**Category Gap Report** — Returns a ranked list of x402 paid-service categories by observed demand, seller concentration, schema/example gaps, registry coverage, and freshness deltas from recurring D1 snapshots.

*Use when:* Use when an agent or builder needs to identify underserved or high-opportunity categories in the x402 paid-API market, such as deciding which type of service to build or where supply is thin relative to demand.

*Not for:* Do not use for real-time price feeds or live transaction data; this report is derived from periodic D1 snapshots and is not a streaming or tick-level data source.

**Inputs:**

- `min_payers` (integer) — Minimum number of observed payers a category must have to appear in results. Use 0 to include categories with no payers.
- `category` (string) — Filter results to a specific category name. Omit to return all categories.
- `limit` (integer) — Maximum number of category gap entries to return. Must be between 1 and 50.

**Returns:** Returns ok=true, a category_gaps array ranked by gap signals (demand, seller concentration, schema coverage, freshness), and a build_recommendation string.

**Example:** `{"min_payers": 0, "limit": 10}`

---

### `fetch-keyword-visibility-pack`

**Keyword Visibility Pack** — Returns paid keyword visibility insights for a domain and query set, including priority terms with scores, rank gaps, rank snapshots per query, and recommended listing copy and route actions.

*Use when:* Use when an agent needs to audit how a specific domain ranks across a set of search queries in the x402 paid API marketplace, identify absent or weak query coverage, and get actionable terms and copy recommendations for improving discoverability.

*Not for:* Do not use for general web SEO analysis or non-x402 marketplace ranking data. Not suitable for real-time keyword volume or trend data outside the x402/CDP ecosystem.

**Inputs:**

- `queries` (array) — Array of 1–20 search query strings to evaluate for keyword visibility. At least one of queries or query must be provided.
- `query` (string) — Single search query string as an alternative or supplement to the queries array.
- `category` (string) — Category filter to scope the visibility analysis.
- `domain` (string) — Domain to evaluate for rank presence across the submitted queries.
- `pay_to` (string) — Seller wallet address or identifier to scope results to a specific seller.
- `limit` (integer) — Maximum number of ranked resources to return per query snapshot (1–25).
- `persist` (boolean) — Whether to persist the rank snapshot results for future delta tracking.

**Returns:** Returns ok=true with a keyword_visibility_pack containing priority_terms with scores, rank_gaps listing absent and weak queries, listing_copy, route_actions, and a rank_snapshots array with per-query top resources including rank, domain, price, and search score.

**Example:** `{"queries":["paid api discovery","verified x402 APIs","x402 endpoint rankings","x402 seller score"],"domain":"x402-market-intel-mcp.mtree.workers.dev","limit":12}`

---

### `fetch-emerging-x402-categories`

**Emerging Category Intel** — Detects x402 market categories where buyer demand, revenue, or payer growth is high relative to supply and metadata completeness, surfacing underserved wedges.

*Use when:* Use when an agent needs to identify newly emerging or underserved x402 API market categories for trend spotting, competitive research, or opportunity discovery.

*Not for:* Do not use for real-time price feeds or individual API listing lookups; use a category or listing search endpoint instead.

**Inputs:**

- `min_payers` (integer) — Minimum number of payers a category must have to be included in results. Must be >= 0.
- `limit` (integer) — Maximum number of emerging categories to return. Must be between 1 and 50 inclusive.

**Returns:** Returns ok=true and an opportunities array listing emerging x402 market categories with high demand relative to supply.

**Example:** `{"min_payers": 1, "limit": 10}`

---

### `fetch-autopay-readiness-matrix`

**Autopay Readiness Matrix** — Scores x402 API routes by payment envelope quality, buyer proof, price risk, seller breadth, freshness, and registry coverage to determine autonomous-spend safety.

*Use when:* Use when an agent needs to evaluate which x402 paid API routes are safe for autonomous (autopay) spending, filtered by category, minimum readiness score, or a natural-language query describing account/risk criteria.

*Not for:* Do not use for real-time price feeds or live payment execution; this returns a pre-computed readiness matrix, not a live quote or transaction.

**Inputs:**

- `query` (string) — Natural-language or structured filter string describing desired route characteristics (e.g. risk level, eligibility, country).
- `category` (string) — Filter results to a specific x402 resource category (e.g. wallet-risk, transaction-intelligence).
- `min_score` (integer) — Minimum readiness score (0–100) to include in results. Rows below this threshold are excluded.
- `limit` (integer) — Maximum number of rows to return (1–50).

**Returns:** Returns ok=true with an autopay_readiness array of scored routes (readiness_score, recommendation, buyer_proof, price_usdc) plus aggregate graph stats covering 588 resources across 171 sellers.

**Example:** `{"query":"account state: eligible=true; autopay=true; customer score >= 70; risk: low; verify bank details; prior failed payments: 0; country: US","min_score":75,"limit":50}`

---

### `generate-proof-lift-report`

**Proof Lift Report** — Combines paid-call telemetry with marketplace rank observations to report route proof coverage, index/rank movement, buyer-query lift, and the next bounded proof action for x402 endpoints.

*Use when:* Use when an agent needs to measure the discovery and ranking impact of paid x402 API calls across one or more search queries, or wants to identify which endpoints are under-indexed and should be targeted for the next proof campaign.

*Not for:* Do not use for real-time price feeds, swap quotes, or wallet risk scoring; those require dedicated financial data endpoints. Not suitable for querying non-x402 API telemetry.

**Inputs:**

- `queries` (array) — Array of 1–20 search query strings to track rank lift for. At least one of `query` or `queries` should be provided.
- `query` (string) — Single search query string to scope the report. Can be used alongside or instead of `queries`.
- `hours` (integer) — Lookback window in hours for paid-call telemetry and rank observations. Minimum 1, maximum 168.
- `endpoint` (string) — Specific x402 endpoint path to filter the report to a single route.
- `limit` (integer) — Maximum number of results to return. Minimum 1, maximum 25.
- `persist` (boolean) — When true, persists the rank snapshot observations for future lift comparisons.

**Returns:** Returns ok=true with a proof_lift summary (paid_hits, spend_usdc, continue_campaign, recommendation), a paid_route_summary array per endpoint, and a rank_lift array per query with index delta and rank observations.

**Example:** `{"queries":["paid api discovery","x402 endpoint rankings","wallet activity risk"],"hours":24,"endpoint":"/v1/x402/autopay_readiness_matrix","limit":10,"persist":true}`

---

### `fetch-buyer-intent-gap-report`

**Buyer Intent Gap Report** — Mines marketplace snapshots and search-rank observations to identify unmet buyer intent, under-indexed API routes, competitor coverage gaps, and next dataset priorities for a set of agent queries.

*Use when:* Use when an agent or developer needs to discover which query topics have high urgency but low x402 API coverage, or wants to prioritize which new data routes to build based on observed buyer demand signals.

*Not for:* Do not use for real-time price feeds, token swaps, or general web search; this is a market intelligence report specific to x402 paid API discovery gaps.

**Inputs:**

- `queries` (array, required) — List of 1–25 query strings representing buyer intents to analyze for coverage gaps.
- `category` (string) — Optional category filter to scope the gap analysis to a specific market segment.
- `limit` (integer) — Maximum number of gap results to return. Integer between 1 and 25.
- `persist_rank_observations` (boolean) — If true, the server persists the search-rank observations from this request for future trend analysis.

**Returns:** Returns ok=true and a buyer_intent_gaps array where each entry contains the query string, an urgency_score integer, the current best marketplace rank (or null if unindexed), and a recommended_route string pointing to the API route that should be built or promoted.

**Example:** `{"queries": ["wallet autopay risk", "paid api discovery", "crypto news"], "limit": 10}`

---

### `monitor-x402-search-rank`

**x402 Market Intel Search Rank Monitor** — Queries the x402 marketplace search-rank index for up to 20 terms, returning per-query rank snapshots including best rank, rank delta, indexed resource count, and top competing resources with pricing and usage stats.

*Use when:* Use when an agent needs to track how a set of API discovery search terms rank in the x402 marketplace, identify top competing resources for those terms, or detect rank changes across recurring snapshots.

*Not for:* Do not use for general web search ranking or SEO monitoring outside the x402 marketplace. Not suitable for real-time rank tracking — data comes from periodic D1 marketplace snapshots, and rank deltas may be null if no prior snapshot exists for a term.

**Inputs:**

- `queries` (array) — Array of 1–20 search terms to monitor for rank position in the x402 marketplace.
- `query` (string) — Single search term to monitor (alternative to the queries array for single-term lookups).
- `limit` (integer) — Maximum number of top competing resources to return per query. Integer between 1 and 25.
- `persist` (boolean) — When true, persists the current snapshot to enable rank delta calculations on future calls.

**Returns:** Returns ok=true, a top-level generated_at timestamp, and a rank_snapshots array with per-query objects containing mt_best_rank, rank_delta, indexed_mt_resources, top_resources (with pricing and 30-day usage stats), and a next_action suggestion.

**Example:** `{"queries":["paid api discovery","x402 endpoint rankings","wallet activity risk"],"limit":10,"persist":true}`

---

### `fetch-endpoint-rankings`

**Endpoint Rankings** — Returns a ranked leaderboard of x402 paid API endpoints scored by revenue, buyer breadth, price, metadata quality, and reliability signals over the past 30 days.

*Use when:* Use when an agent needs to discover, compare, or rank x402 paid API endpoints by market performance signals such as buyer demand, revenue, payer count, or metadata quality to inform API selection or market analysis.

*Not for:* Do not use for real-time price feeds or live transaction data; this returns aggregated 30-day market intelligence snapshots, not streaming or per-call data.

**Inputs:**

- `mode` (string) — Ranking mode controlling how endpoints are scored and sorted. One of: 'balanced', 'buyer_demand', 'quality', 'price'.
- `category` (string) — Filter results to a specific endpoint category (e.g. 'transaction-intelligence', 'wallet-risk', 'market-data').
- `limit` (integer) — Maximum number of ranked endpoints to return. Integer between 1 and 100.

**Returns:** Returns ok=true and an endpoint_rankings array of up to 25 objects each containing rank, seller_score, revenue_30d_usdc, resource URL, calls_30d, payers_30d, price_micro, registry flags, and metadata coverage flags.

**Example:** `{"mode": "buyer_demand", "limit": 25}`

---

### `fetch-verified-x402-endpoints`

**Verified Endpoint Index** — Returns a ranked directory of verified x402 pay-per-call endpoints with seller score, 30-day revenue, call volume, payer count, schema quality flags, and registry coverage.

*Use when:* Use when an agent needs to discover active x402 API endpoints ranked by usage and quality, such as when routing to a paid API, auditing available x402 services, or selecting a vendor by revenue or schema completeness.

*Not for:* Do not use for real-time price feeds or live payment routing; the min_score filter is not reliably enforced server-side, so do not depend on it as a hard cutoff for vendor selection.

**Inputs:**

- `min_score` (integer) — Minimum seller score (0–100) to filter endpoints. Note: server-side enforcement of this filter is unreliable per observed behavior.
- `limit` (integer) — Maximum number of endpoints to return (1–100).

**Returns:** Returns ok=true and an endpoint_rankings array where each entry includes rank, seller_score, resource URL, category, 30-day revenue/calls/payers in USDC and micro-units, registry flags, and schema quality indicators.

**Example:** `{"min_score": 60, "limit": 20}`

---

### `discover-paid-x402-apis`

**x402 Paid API Discovery** — Searches and ranks verified x402 pay-per-call endpoints by buyer demand, price, schema coverage, seller score, and route reliability.

*Use when:* Use when an agent needs to find available x402 paid APIs matching a topic or category, compare endpoint rankings, or identify which pay-per-call services exist before routing a task to one of them.

*Not for:* Do not use for calling or executing a discovered API — this endpoint only returns discovery metadata. Not suitable for real-time price feeds or streaming data.

**Inputs:**

- `query` (string) — Free-text search query describing the type of API or capability to discover.
- `category` (string) — Category filter to narrow results to a specific domain of APIs.
- `limit` (integer) — Maximum number of results to return. Must be between 1 and 100.

**Returns:** Returns ok=true, a top_resources array of ranked x402 API endpoints, and a graph object with market intelligence relationships.

**Example:** `{"query": "transaction simulation", "limit": 20}`

---

### `rank-x402-services`

**X402 Service Rank** — Ranks x402 API services by price, live marketplace demand, schema quality, payment behavior, seller evidence, freshness, and risk flags for a given buyer intent.

*Use when:* Use when an agent needs to select the best x402 API to call for a given task — comparing candidates by cost, usage volume, quality score, and risk flags before committing spend.

*Not for:* Do not use for general web search ranking or non-x402 API discovery. Not a substitute for calling the ranked services themselves — this only returns ranked metadata, not the underlying data.

**Inputs:**

- `preset` (string) — Lane preset that tunes ranking weights. One of: web_search, onchain_risk, enrichment, spend_control.
- `intent` (string) — Natural-language description of what the agent wants to accomplish, used to match services.
- `query` (string) — Free-text query describing the specific data or capability needed, used to surface relevant services.
- `category` (string) — Optional category filter to restrict results to a specific service category.
- `budget_usdc` (number) — Maximum per-call price in USDC the agent is willing to pay; filters out services above this threshold.
- `risk_tolerance` (string) — Acceptable risk level for ranked services. One of: low, medium, high.
- `limit` (integer) — Maximum number of ranked services to return. Integer between 1 and 25.

**Returns:** Returns ok=true with a lane_preset object, buyer_intent echo, and a ranked_services array of up to 25 services each with score, price_usdc, calls_30d, payers_30d, quality_score, risk_flags, and an evidence block.

**Example:** `{"preset":"onchain_risk","intent":"rank_service_providers","query":"largest decentralized exchange volume by stablecoin pairs; exclude sanctioned entities; include current top liquidity pools and recent wash-trading risk","budget_usdc":2500,"risk_tolerance":"medium","limit":5}`

---

### `fetch-provider-dossier`

**Provider Dossier** — Returns a trust dossier for an x402 provider including verdict, trust score, service map, pricing distribution, buyer/call evidence, registry coverage, and spend-policy signals.

*Use when:* Use when an agent needs to evaluate the credibility or trustworthiness of an x402 provider before routing payments or integrating a service, given a provider name, pay_to address, or domain.

*Not for:* Do not use for real-time price feeds or live transaction status; this is a static intelligence snapshot, not a streaming or transactional endpoint.

**Inputs:**

- `provider` (string) — Provider identifier or name to look up (e.g. a hostname or service slug).
- `pay_to` (string) — Seller payTo address or identifier associated with the provider.
- `domain` (string) — Domain associated with the provider.
- `resource` (string) — Specific resource path or capability to scope the dossier query.
- `limit` (integer) — Maximum number of entries to return in list fields (1–25).

**Returns:** Returns ok=true with a dossier object containing verdict, trust_score, calls_30d, payers_30d, revenue_30d_usdc, source_counts, flagship_paid_answers, and a sample_resources array.

**Example:** `{"provider": "x402-market-intel-mcp.mtree.workers.dev", "limit": 10}`

---

### `check-x402-endpoint-risk`

**Endpoint Risk Check** — Audits an x402 API endpoint for payment metadata sanity, 402 behavior, schema completeness, price outliers, and replay/binding issues, returning a verdict and risk flags.

*Use when:* Use when an agent needs to evaluate the trustworthiness and compliance of an x402 endpoint before paying for it, including checking for missing payment headers, registry presence, and live 402 probe results.

*Not for:* Do not use for general HTTP health checks or non-x402 APIs; this audit is specific to x402 payment protocol compliance and discovery indexability.

**Inputs:**

- `url` (string) — Full URL of the x402 endpoint to audit.
- `resource` (string) — x402 resource identifier or canonical URL for the paid resource.
- `method` (string) — HTTP method used to call the endpoint (e.g. POST, GET).
- `budget_usdc` (number) — Optional USDC budget ceiling for the resource being audited, used for price outlier detection.

**Returns:** Returns ok=true with a verdict (e.g. manual_review), risk_flags array, live probe results, per-check indexability diagnostics, directory submission matrix, and seller remediation steps.

**Example:** `{"url": "https://api.x402.example.com/v1/transfer/submit", "resource": "x402:transfer:submit#wire-usdc-v2", "budget_usdc": 1250.75}`

---

### `fetch-x402-market-map`

**x402 Market Map Intel** — Returns a cross-source category and seller map for x402 paid APIs, including revenue, call volume, payer concentration, registry coverage, and schema-quality metrics for up to 100 resources.

*Use when:* Use when an agent needs a structured overview of the x402 paid-API ecosystem: category-level revenue and payer stats, top-performing resources by calls or revenue, seller concentration, and metadata completeness gaps across registries.

*Not for:* Do not use for real-time price feeds or individual API pricing lookups; this returns aggregated 30-day market intelligence, not live per-call quotes.

**Inputs:**

- `limit` (integer) — Maximum number of top resources to return. Must be between 1 and 100 inclusive.
- `category` (string) — Filter results to a specific category slug (e.g. 'wallet-risk', 'transaction-intelligence', 'market-data').

**Returns:** Returns ok=true plus a graph object with aggregate stats (588 resources, 171 sellers, 30-day revenue/calls/payers), category breakdowns with revenue and metadata depth, and a ranked top_resources array with per-resource call, revenue, payer, and schema-quality data.

**Example:** `{"limit": 50}`

---
