get_competitor
Retrieve detailed information about a specific competitor using its unique ID. Enables competitive analysis for social media and content strategy.
Instructions
Get detailed info for a single competitor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| competitor_id | Yes | UUID from list_competitors results | |
| org_id | No | Optional — override the org bound to the API key |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/yaparai/tools/enterprise.py:50-65 (handler)The `get_competitor` async function is the tool handler. It takes a competitor_id (UUID) and optional org_id, creates a YaparAIClient, and delegates to client.enterprise_get_competitor().
async def get_competitor( competitor_id: str, org_id: str | None = None, ) -> dict: """ Get detailed info for a single competitor. Args: competitor_id: UUID from list_competitors results org_id: Optional — override the org bound to the API key Returns: Competitor profile including name, website, industry, notes. """ client = YaparAIClient() return await client.enterprise_get_competitor(competitor_id, org_id=org_id) - The function signature defines the schema: competitor_id (str, required) and org_id (str | None, optional). The docstring describes the return as a competitor profile dict with name, website, industry, notes.
async def get_competitor( competitor_id: str, org_id: str | None = None, ) -> dict: """ Get detailed info for a single competitor. Args: competitor_id: UUID from list_competitors results org_id: Optional — override the org bound to the API key Returns: Competitor profile including name, website, industry, notes. """ client = YaparAIClient() return await client.enterprise_get_competitor(competitor_id, org_id=org_id) - src/yaparai/server.py:94-101 (registration)Import of get_competitor from yaparai.tools.enterprise.
from yaparai.tools.enterprise import ( list_competitors, get_competitor, compare_competitors, list_org_products, create_org_product, update_product_stock, ) - src/yaparai/server.py:176-182 (registration)Registration via mcp.tool(get_competitor) on line 178, registering it as an MCP tool under 'Enterprise: Competitor Analysis + Product Catalog'.
# Enterprise: Competitor Analysis + Product Catalog (v0.5.0) (6) mcp.tool(list_competitors) mcp.tool(get_competitor) mcp.tool(compare_competitors) mcp.tool(list_org_products) mcp.tool(create_org_product) mcp.tool(update_product_stock) - src/yaparai/client.py:331-339 (helper)The underlying HTTP client method `enterprise_get_competitor` that makes the GET request to /v1/public/enterprise/competitors/{competitor_id} with optional X-Organization-Id header.
async def enterprise_get_competitor( self, competitor_id: str, org_id: str | None = None ) -> dict: headers = {"X-Organization-Id": org_id} if org_id else {} return await self._request( "GET", f"/v1/public/enterprise/competitors/{competitor_id}", headers=headers, )