get_article
Fetch an Intercom article by ID to retrieve its full details including title, body, author, and state.
Instructions
Get a single Intercom article by ID. Returns full article details including title, body, author, and state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The article ID (e.g., "123456") |
Implementation Reference
- src/index.ts:165-178 (schema)Schema definition for the 'get_article' tool. It declares the tool name, description, and input schema requiring a string 'id' property.
{ name: 'get_article', description: 'Get a single Intercom article by ID. Returns full article details including title, body, author, and state.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The article ID (e.g., "123456")' } }, required: ['id'] } }, - src/index.ts:592-607 (handler)Handler for the 'get_article' tool. Extracts the 'id' argument, validates it, calls the Intercom API at /articles/{id}, and returns the full article details as JSON.
if (name === 'get_article') { const { id } = args as { id: string }; if (!id) { throw new Error('Article ID is required'); } const article = await callIntercomAPI(`/articles/${id}`); return { content: [{ type: 'text', text: JSON.stringify(article, null, 2) }] }; } - src/index.ts:113-145 (helper)Helper function that makes HTTP requests to the Intercom API. Used by the get_article handler to call GET /articles/{id}.
async function callIntercomAPI( endpoint: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' = 'GET', body?: any ): Promise<any> { const options: RequestInit = { method, headers: { 'Authorization': `Bearer ${INTERCOM_TOKEN}`, 'Accept': 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14' } }; if (body && (method === 'POST' || method === 'PUT')) { options.body = JSON.stringify(body); } const response = await fetch(`${INTERCOM_API_BASE}${endpoint}`, options); if (!response.ok) { const error = await response.text(); throw new Error(`Intercom API error: ${response.status} - ${error}`); } // Handle 204 No Content response if (response.status === 204) { return { success: true }; } return response.json(); } - src/index.ts:162-582 (registration)Registration of the 'get_article' tool via the ListToolsRequestSchema handler, making it available in the MCP server's tool list.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'get_article', description: 'Get a single Intercom article by ID. Returns full article details including title, body, author, and state.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The article ID (e.g., "123456")' } }, required: ['id'] } }, { name: 'list_articles', description: 'List Intercom articles with pagination. Returns a list of articles with basic information.', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)', default: 1 }, per_page: { type: 'number', description: 'Number of articles per page (default: 10, max: 50)', default: 10 } } } }, { name: 'create_article', description: 'Create a new Intercom Help Center article. Supports multilingual content and draft/published states.', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Article title (required)' }, body: { type: 'string', description: 'Article content in HTML format (required)' }, author_id: { type: 'number', description: 'Author ID - must be a valid Intercom admin ID (required). Use list_admins to find valid IDs by name.' }, description: { type: 'string', description: 'Article description (optional)' }, state: { type: 'string', enum: ['draft', 'published'], description: 'Article state (optional, default: draft)' }, parent_id: { type: 'string', description: 'Parent ID - collection or section ID (optional)' }, parent_type: { type: 'string', enum: ['collection'], description: 'Parent type (optional, default: collection)' }, translated_content: { type: 'object', description: 'Multilingual content. Key is locale code (e.g., "zh-TW"), value is translation object', additionalProperties: { type: 'object', properties: { title: { type: 'string', description: 'Translated title' }, body: { type: 'string', description: 'Translated content in HTML' }, description: { type: 'string', description: 'Translated description' }, author_id: { type: 'number', description: 'Author ID for translation' }, state: { type: 'string', enum: ['draft', 'published'], description: 'Translation state' } }, required: ['title', 'body', 'author_id'] } } }, required: ['title', 'body', 'author_id'] } }, { name: 'update_article', description: 'Update an existing Intercom Help Center article. Supports partial updates and multilingual content.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Article ID (required)' }, title: { type: 'string', description: 'Updated article title (optional)' }, body: { type: 'string', description: 'Updated article content in HTML format (optional)' }, description: { type: 'string', description: 'Updated article description (optional)' }, state: { type: 'string', enum: ['draft', 'published'], description: 'Updated article state (optional)' }, author_id: { type: 'number', description: 'Updated author ID (optional). Use list_admins to find valid IDs by name.' }, translated_content: { type: 'object', description: 'Updated multilingual content. Only provided fields will be updated.', additionalProperties: { type: 'object', properties: { title: { type: 'string', description: 'Updated translated title' }, body: { type: 'string', description: 'Updated translated content in HTML' }, description: { type: 'string', description: 'Updated translated description' }, state: { type: 'string', enum: ['draft', 'published'], description: 'Updated translation state' } } } } }, required: ['id'] } }, { name: 'delete_article', description: 'Delete an Intercom Help Center article. WARNING: This action cannot be undone. The article will be permanently removed.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Article ID to delete (required)' } }, required: ['id'] } }, { name: 'list_collections', description: 'List all Intercom Help Center collections. Collections are top-level categories that contain sections and articles.', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)', default: 1 }, per_page: { type: 'number', description: 'Number of collections per page (default: 50, max: 150)', default: 50 } } } }, { name: 'get_collection', description: 'Get a single Intercom Help Center collection by ID. Returns full collection details including name, description, and metadata.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The collection ID (e.g., "123456")' } }, required: ['id'] } }, { name: 'create_collection', description: 'Create a new Intercom Help Center collection. Collections are top-level categories that contain sections and articles.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Collection name (required)' }, description: { type: 'string', description: 'Collection description (optional)' }, parent_id: { type: 'string', description: 'Parent collection ID for nesting (optional, null for top-level)' }, translated_content: { type: 'object', description: 'Multilingual content. Key is locale code (e.g., "zh-TW"), value is translation object', additionalProperties: { type: 'object', properties: { name: { type: 'string', description: 'Translated collection name' }, description: { type: 'string', description: 'Translated collection description' } } } } }, required: ['name'] } }, { name: 'update_collection', description: 'Update an existing Intercom Help Center collection. Supports updating name, description, and multilingual translations.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Collection ID (required)' }, name: { type: 'string', description: 'Updated collection name (optional, updates default language)' }, description: { type: 'string', description: 'Updated collection description (optional, updates default language)' }, parent_id: { type: 'string', description: 'Updated parent collection ID (optional, null for top-level)' }, translated_content: { type: 'object', description: 'Updated multilingual content. Key is locale code (e.g., "zh-TW"), value is translation object', additionalProperties: { type: 'object', properties: { name: { type: 'string', description: 'Translated collection name' }, description: { type: 'string', description: 'Translated collection description' } } } } }, required: ['id'] } }, { name: 'delete_collection', description: 'Delete an Intercom Help Center collection. WARNING: This action cannot be undone. The collection and all its contents will be permanently removed.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Collection ID to delete (required)' } }, required: ['id'] } }, { name: 'search_articles', description: 'Search for Intercom Help Center articles using keywords. Returns summary fields (id, title, description, state, url, author_id, created_at, updated_at, parent_id, parent_type) for each match. Use get_article to fetch the full content of a specific article.', inputSchema: { type: 'object', properties: { phrase: { type: 'string', description: 'Search phrase/keywords to find in articles (optional)' }, state: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by article state (optional, default: all)' }, help_center_id: { type: 'string', description: 'Filter by specific Help Center ID (optional)' } }, required: [] } }, { name: 'reply_conversation', description: 'Reply to an Intercom conversation as an admin. Use this to send a message visible to the customer.', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', description: 'The conversation ID to reply to (required)' }, body: { type: 'string', description: 'The reply message body (required). Supports HTML.' }, admin_id: { type: 'string', description: 'Admin ID to reply as (optional, defaults to INTERCOM_ADMIN_ID env var)' } }, required: ['conversation_id', 'body'] } }, { name: 'add_conversation_note', description: 'Add an internal note to an Intercom conversation. Notes are only visible to team members, not customers.', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', description: 'The conversation ID to add a note to (required)' }, body: { type: 'string', description: 'The note content (required). Supports HTML.' }, admin_id: { type: 'string', description: 'Admin ID adding the note (optional, defaults to INTERCOM_ADMIN_ID env var)' } }, required: ['conversation_id', 'body'] } }, { name: 'close_conversation', description: 'Close an Intercom conversation.', inputSchema: { type: 'object', properties: { conversation_id: { type: 'string', description: 'The conversation ID to close (required)' } }, required: ['conversation_id'] } }, { name: 'update_ticket_state', description: 'Update the state of an Intercom ticket.', inputSchema: { type: 'object', properties: { ticket_id: { type: 'string', description: 'The ticket ID to update (required)' }, state: { type: 'string', enum: ['in_progress', 'waiting_on_customer', 'resolved'], description: 'The new ticket state (required)' } }, required: ['ticket_id', 'state'] } }, { name: 'list_admins', description: 'List all Intercom workspace admins/team members. Returns IDs, names, and emails. Useful for discovering valid author_id or admin_id values.', inputSchema: { type: 'object', properties: {} } } ] };