get_publisher_by_id
Retrieve detailed metadata, verification status, and operational metrics for a digital advertising publisher by specifying its unique Publisher ID using the OpenSincera MCP Server API.
Instructions
Get a single publisher by publisher ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publisherId | Yes | Publisher ID to search for |
Implementation Reference
- src/index.ts:196-219 (handler)MCP CallToolRequest handler case for 'get_publisher_by_id': validates input schema, invokes OpenSinceraService.getPublisherById(), formats result with metadata descriptions or returns not-found message.case 'get_publisher_by_id': { const input = GetPublisherByIdSchema.parse(request.params.arguments); const result = await openSinceraService.getPublisherById(input.publisherId); if (result) { const formatted = formatPublisherWithDescriptions(result, 'en'); return { content: [ { type: 'text', text: formatted, }, ], }; } else { return { content: [ { type: 'text', text: `No publisher found for ID: ${input.publisherId}`, }, ], }; }
- src/index.ts:43-45 (schema)Zod input validation schema for get_publisher_by_id tool: requires publisherId string.const GetPublisherByIdSchema = z.object({ publisherId: z.string().min(1), });
- src/index.ts:110-124 (registration)Tool registration in ListToolsRequest handler: defines name 'get_publisher_by_id', description, and JSON inputSchema matching the Zod schema.{ name: 'get_publisher_by_id', description: `Get detailed publisher information by Publisher ID with comprehensive metric descriptions. Returns formatted data including performance metrics, supply chain information, and detailed explanations of each field's meaning and business impact.`, inputSchema: { type: 'object', properties: { publisherId: { type: 'string', description: 'Publisher ID to search for', }, }, required: ['publisherId'], additionalProperties: false, }, },
- src/opensincera-service.ts:277-286 (helper)OpenSinceraService helper method: retrieves publisher metadata by ID via internal getPublisherMetadata call, returns PublisherMetadata or null.async getPublisherById(publisherId: string): Promise<PublisherMetadata | null> { try { const response = await this.getPublisherMetadata({ publisherId, limit: 1 }); return response.publishers.length > 0 ? response.publishers[0] : null; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; console.error('Failed to get publisher by ID', { publisherId, error: errorMessage }); throw error; } }