get_pricing
Check current per-endpoint pricing on koreafilings.com. Retrieve the x402 wallet address, network, USDC contract, and price in USDC for each paid endpoint to confirm payment details upfront, without any cost.
Instructions
Fetch the current per-endpoint pricing for koreafilings.com.
This is a free call; it returns the x402 wallet address, network, USDC contract, and the price in USDC for each paid endpoint. Useful to confirm the payer will be settling on the expected chain before spending anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp/src/koreafilings_mcp/server.py:77-93 (handler)MCP tool handler for 'get_pricing'. Decorated with @mcp.tool(), it creates a temporary client with a dummy key (free endpoint), calls the SDK's get_pricing(), closes the client, and returns the Pricing model as a dict.
@mcp.tool() def get_pricing() -> dict[str, Any]: """Fetch the current per-endpoint pricing for koreafilings.com. This is a free call; it returns the x402 wallet address, network, USDC contract, and the price in USDC for each paid endpoint. Useful to confirm the payer will be settling on the expected chain before spending anything. """ network = os.environ.get("KOREAFILINGS_NETWORK", "base-sepolia").strip() or "base-sepolia" base_url = os.environ.get("KOREAFILINGS_BASE_URL", "https://api.koreafilings.com").strip() probe = Client(private_key="0x" + "00" * 32, network=network, base_url=base_url) try: pricing = probe.get_pricing() finally: probe.close() return pricing.model_dump(by_alias=True) - The Pricing Pydantic model returned by get_pricing(). Contains fields: x402_network, x402_asset, x402_recipient, and a list of PricingEndpoint objects.
class Pricing(BaseModel): """Machine-readable pricing descriptor from ``GET /v1/pricing``.""" model_config = ConfigDict(populate_by_name=True, frozen=True) x402_network: str = Field(alias="x402Network") x402_asset: str = Field(alias="x402Asset") x402_recipient: str = Field(alias="x402Recipient") endpoints: List["PricingEndpoint"] - The PricingEndpoint sub-model within Pricing, containing method, path, price_usdc, and description for each endpoint.
class PricingEndpoint(BaseModel): model_config = ConfigDict(populate_by_name=True, frozen=True) method: str path: str price_usdc: str = Field(alias="priceUsdc") description: str - The SDK-level Client.get_pricing() method. Makes an HTTP GET to /v1/pricing and deserializes the response into the Pricing Pydantic model.
def get_pricing(self) -> Pricing: """Fetch the public pricing descriptor. No payment required.""" resp = self._http.get(f"{self._base_url}/v1/pricing") if resp.status_code != 200: raise ApiError(resp.status_code, _safe_json(resp)) return Pricing.model_validate(resp.json()) - mcp/src/koreafilings_mcp/server.py:77-77 (registration)Registration of the get_pricing tool via the @mcp.tool() decorator on line 77. FastMCP registers it automatically when the decorator is applied.
@mcp.tool()