verify
Verify eBay API credentials — user tokens or application-only keysets — to confirm authentication and enable account access.
Instructions
Verify credentials.
User token: Commerce Identity profile. Application-only keyset: Browse ping + totals.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- ebay_mcp/client.py:276-276 (handler)Core handler for the 'verify' tool. Calls Commerce Identity API for user tokens or does a Browse search ping for application-only tokens.
def verify(self) -> Dict[str, Any]: - ebay_mcp/client.py:276-321 (handler)Full implementation of EbayClient.verify() — the core handler logic for the verify tool.
def verify(self) -> Dict[str, Any]: """Ping OAuth credentials. With a **User** token: Commerce Identity GET ``/commerce/identity/v1/user/``. With **Application** credentials only: skips Identity (needs User OAuth), runs a minimal Browse search as connectivity proof. """ if self.token_kind == "application": probe = self.search_item_summary( "electronics", limit=1, offset=0, sort=None, ) first = None summaries = probe.get("itemSummaries") if isinstance(summaries, list) and summaries: row = summaries[0] if isinstance(row, dict): first = { "title": row.get("title"), "itemOriginDate": row.get("itemOriginDate"), "itemWebUrl": row.get("itemWebUrl"), } return { "token_kind": "application", "note": ( "Commerce Identity requires a User OAuth token (ebay-mcp-auth). " "Browse ping succeeded using application credentials." ), "browse_total_estimate": probe.get("total"), "browse_sample_item": first, } url = f"{self.commerce_root}/commerce/identity/v1/user/" data = self._request_json( "GET", url, retry_refresh=True, ) if not isinstance(data, dict): raise EbayError(f"Unexpected identity payload: {type(data)!r}") out = dict(data) out["token_kind"] = "user" return out - ebay_mcp/server.py:21-26 (registration)Registration of the 'verify' tool via @mcp.tool() decorator on the verify() function in server.py.
@mcp.tool() def verify() -> Dict[str, Any]: """Verify credentials. User token: Commerce Identity profile. Application-only keyset: Browse ping + totals.""" return _client().verify() - ebay_mcp/check.py:55-55 (helper)Smoke-test script calling client.verify() for end-to-end validation.
_dump("verify (Commerce Identity user)", client.verify()) - ebay_mcp/server.py:14-18 (registration)Helper factory function _client() that creates EbayClient instance used by the verify tool.
def _client() -> EbayClient: try: return EbayClient() except EbayError as exc: raise RuntimeError(str(exc)) from exc