Skip to main content
Glama
jhanglim
by jhanglim

get_post_thread

Retrieve the complete thread of a specific Mattermost post, including author names and usernames for comprehensive conversation context.

Instructions

특정 게시물의 전체 스레드를 가져옵니다. 결과에는 자동으로 작성자의 이름(user_name)과 username이 포함됩니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYes게시물 ID

Implementation Reference

  • MCP server tool handler for 'get_post_thread': extracts post_id, calls client.getPostThread, enriches posts with user info and formatted timestamps, returns JSON.
    case "get_post_thread": { const postId = args.post_id as string; const thread = await client.getPostThread(postId); // 고유한 user_id 추출 및 사용자 정보 조회 const uniqueUserIds = [...new Set(thread.order?.map((postId: string) => thread.posts[postId].user_id) || [])]; const userMap = await client.getUsersInfo(uniqueUserIds); const posts = thread.order?.map((postId: string) => { const post = thread.posts[postId]; const createTime = formatTimestamp(post.create_at); const userInfo = userMap.get(post.user_id); return { id: post.id, message: post.message, user_id: post.user_id, username: userInfo?.username || "unknown", user_name: userInfo?.name || "Unknown User", create_at: createTime, }; }) || []; return { content: [ { type: "text", text: JSON.stringify({ posts: posts, }, null, 2), }, ], }; }
  • src/index.ts:303-316 (registration)
    Tool registration in ListTools handler, defining name, description, and input schema requiring 'post_id'.
    { name: "get_post_thread", description: "특정 게시물의 전체 스레드를 가져옵니다. 결과에는 자동으로 작성자의 이름(user_name)과 username이 포함됩니다.", inputSchema: { type: "object", properties: { post_id: { type: "string", description: "게시물 ID", }, }, required: ["post_id"], }, },
  • MattermostClient helper method that makes API request to fetch the post thread from Mattermost server.
    async getPostThread(postId: string): Promise<MattermostPostsResult> { return await this.request(`/posts/${postId}/thread`) as MattermostPostsResult; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jhanglim/mattermost-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server