edit_thread
Update an existing thread's title, content, category, privacy settings, or other attributes by specifying only the fields you want to change.
Instructions
Edit an existing thread. Only provided fields are updated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thread_id | Yes | Global thread ID | |
| title | No | New title | |
| content | No | New body (markdown or Ed XML) | |
| type | No | ||
| category | No | ||
| subcategory | No | ||
| is_private | No | ||
| is_anonymous | No | ||
| is_pinned | No |
Implementation Reference
- src/api.ts:155-165 (handler)The API method that performs the actual network request to update the thread.
async editThread( threadId: number, params: EdEditThreadParams ): Promise<{ thread: EdThread }> { // Fetch current thread to merge fields const current = await this.getThread(threadId); const merged = { ...current.thread, ...params }; return this.request<{ thread: EdThread }>("PUT", `threads/${threadId}`, { thread: merged, }); } - src/index.ts:247-270 (registration)The tool registration for 'edit_thread', which handles input parsing, optional content formatting, and calling the API handler.
server.tool( "edit_thread", "Edit an existing thread. Only provided fields are updated.", { thread_id: z.number().describe("Global thread ID"), title: z.string().optional().describe("New title"), content: z.string().optional().describe("New body (markdown or Ed XML)"), type: z.enum(["post", "question", "announcement"]).optional(), category: z.string().optional(), subcategory: z.string().optional(), is_private: z.boolean().optional(), is_anonymous: z.boolean().optional(), is_pinned: z.boolean().optional(), }, async ({ thread_id, content, ...rest }) => { try { const params: EdEditThreadParams = { ...rest }; if (content !== undefined) { params.content = ensureEdXml(content); } const result = await api.editThread(thread_id, params); return ok(result); } catch (err) { return fail(err); - src/types.ts:148-152 (schema)Type definition for the parameters used to edit a thread.
export interface EdEditThreadParams { type?: string; title?: string; category?: string; subcategory?: string;