{"openapi":"3.1.0","info":{"title":"TKN MCP Service","version":"1.0.0","description":"REST and MCP API for the TKN testnet. Create wallets, request faucet funds, and send transactions on the TKN testnet (chain ID 7474)."},"servers":[{"url":"https://mcp.tkn.xyz"}],"paths":{"/api/rest/get-status":{"get":{"operationId":"getStatus","summary":"Returns the current server status","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/rest/create-wallet":{"get":{"operationId":"createWallet","summary":"Generate a new EVM wallet keypair for the TKN testnet","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/rest/faucet-balance":{"get":{"operationId":"faucetBalance","summary":"Check the faucet wallet's remaining TKN balance","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/rest/faucet":{"post":{"operationId":"faucet","summary":"Send testnet TKN to a wallet address from the faucet","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"Recipient wallet address (0x...)"},"amount":{"type":"string","description":"Amount of TKN to send (default: 1)"}}}}}}}},"/api/rest/send-transaction":{"post":{"operationId":"sendTransaction","summary":"Send TKN from a wallet to another address on the testnet","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["privateKey","to","value"],"properties":{"privateKey":{"type":"string","description":"Sender wallet private key (0x...)"},"to":{"type":"string","description":"Recipient address (0x...)"},"value":{"type":"string","description":"Amount of TKN to send"}}}}}}}},"/api/rest/read-contract":{"post":{"operationId":"readContract","summary":"Call a read-only function on a verified smart contract. Returns the result. If the function name is wrong, returns a list of available read functions.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contractAddress","functionName"],"properties":{"contractAddress":{"type":"string","description":"Contract address (0x...)"},"functionName":{"type":"string","description":"Name of the view/pure function to call"},"args":{"type":"array","description":"Function arguments as a JSON array (default: [])"}}}}}}}},"/api/rest/write-contract":{"post":{"operationId":"writeContract","summary":"Call a state-changing function on a verified smart contract. Requires a private key to sign the transaction. If the function name is wrong, returns a list of available write functions.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["privateKey","contractAddress","functionName"],"properties":{"privateKey":{"type":"string","description":"Signer wallet private key (0x...)"},"contractAddress":{"type":"string","description":"Contract address (0x...)"},"functionName":{"type":"string","description":"Name of the state-changing function to call"},"args":{"type":"array","description":"Function arguments as a JSON array (default: [])"}}}}}}}},"/api/rest/submit-token-data":{"post":{"operationId":"submitTokenData","summary":"Submit datapoints for a token to the TKN L2Storage contract. Accepts a tokenId and a data object of field/value pairs. Validates fields against the 41 allowed datapoint types. Calls setTokenDataBatch on-chain.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["privateKey","tokenId","data"],"properties":{"privateKey":{"type":"string","description":"Signer wallet private key (0x...)"},"tokenId":{"type":"string","description":"Numeric token ID to update"},"data":{"type":"object","description":"Object of field/value pairs, e.g. { name: \"Tether\", symbol: \"USDT\" }. Valid fields: name, description, avatar, url, symbol, decimals, contractAddress, twitter, github, discord, and 31 more."}}}}}}}},"/api/rest/get-token-data":{"post":{"operationId":"getTokenData","summary":"Read datapoints for a token from the TKN L2Storage contract. Returns the stored values for the requested fields, plus a list of any empty fields.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tokenId","fields"],"properties":{"tokenId":{"type":"string","description":"Numeric token ID to query"},"fields":{"type":"array","description":"Array of field names to read, e.g. [\"name\", \"symbol\", \"decimals\"]"}}}}}}}},"/api/rest/server-info":{"get":{"operationId":"serverInfo","summary":"Server metadata: name, version, and capabilities","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/rest/token-storage-contract":{"get":{"operationId":"tokenStorageContract","summary":"Address and metadata for the TKN L2Storage contract on testnet","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}