get_news_detail
Retrieve detailed information for a specific news article by providing its ID. Optionally mark the article as read. Access secure data from the N Lobby portal.
Instructions
Retrieve detailed information for a specific news article
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markAsRead | No | Mark the news article as read (optional, default: false) | |
| newsId | Yes | The ID of the news article to retrieve |
Implementation Reference
- src/server.ts:526-563 (handler)Handler for the get_news_detail tool. Extracts newsId and optional markAsRead from arguments, fetches news detail using this.api.getNewsDetail, optionally marks as read, and returns JSON stringified response or error message.case "get_news_detail": try { const { newsId, markAsRead = false } = args as { newsId: string; markAsRead?: boolean; }; const newsDetail = await this.api.getNewsDetail(newsId); if (markAsRead) { try { await this.api.markNewsAsRead(newsId); } catch (markError) { logger.error( `Failed to mark news ${newsId} as read:`, markError, ); } } return { content: [ { type: "text", text: JSON.stringify(newsDetail, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}\n\nTo authenticate:\n1. Login to N Lobby in your browser\n2. Open Developer Tools (F12)\n3. Go to Application/Storage tab\n4. Copy cookies and use the set_cookies tool\n5. Use health_check to verify connection`, }, ], }; }
- src/server.ts:183-203 (registration)Registration of the get_news_detail tool in the ListTools response, including name, description, and input schema definition.{ name: "get_news_detail", description: "Retrieve detailed information for a specific news article", inputSchema: { type: "object", properties: { newsId: { type: "string", description: "The ID of the news article to retrieve", }, markAsRead: { type: "boolean", description: "Mark the news article as read (optional, default: false)", default: false, }, }, required: ["newsId"], }, },
- src/server.ts:187-201 (schema)Input schema definition for the get_news_detail tool, specifying required newsId and optional markAsRead parameters.inputSchema: { type: "object", properties: { newsId: { type: "string", description: "The ID of the news article to retrieve", }, markAsRead: { type: "boolean", description: "Mark the news article as read (optional, default: false)", default: false, }, }, required: ["newsId"],