Skip to main content
Glama

set_prompts

Configure global task prompts by setting instructions, prefixes, and suffixes to standardize task formatting and provide consistent context across all tasks.

Instructions

Set the global prompts configuration with instructions, taskPrefix, and/or taskSuffix.

This replaces any existing prompts settings with the new values provided.

  • 'instructions': General instructions or context shown at the top of each task

  • 'taskPrefix': Text to prepend before each task description

  • 'taskSuffix': Text to append after each task description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instructionsNo
taskPrefixNo
taskSuffixNo

Implementation Reference

  • MCP tool handler for 'set_prompts': extracts instructions, taskPrefix, taskSuffix from args and calls service.setPrompts
    async set_prompts(args: any) { const { instructions, taskPrefix, taskSuffix } = args ?? {}; return service.setPrompts({ instructions, taskPrefix, taskSuffix }); },
  • Tool schema definition for 'set_prompts' including input schema for optional prompts fields: instructions, taskPrefix, taskSuffix
    export const SET_PROMPTS_TOOL: Tool = { name: "set_prompts", description: "Set the global prompts configuration with instructions, taskPrefix, and/or taskSuffix.\n\n" + "This replaces any existing prompts settings with the new values provided.\n\n" + "- 'instructions': General instructions or context shown at the top of each task\n" + "- 'taskPrefix': Text to prepend before each task description\n" + "- 'taskSuffix': Text to append after each task description", inputSchema: { type: "object", properties: { instructions: { type: "string" }, taskPrefix: { type: "string" }, taskSuffix: { type: "string" }, }, }, };
  • Registration of SET_PROMPTS_TOOL in the server's listTools response handler, making it available to MCP clients
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ PLAN_TASK_TOOL, GET_NEXT_TASK_TOOL, MARK_TASK_DONE_TOOL, OPEN_TASK_DETAILS_TOOL, LIST_REQUESTS_TOOL, ADD_TASKS_TO_REQUEST_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, ADD_SUBTASKS_TOOL, MARK_SUBTASK_DONE_TOOL, UPDATE_SUBTASK_TOOL, DELETE_SUBTASK_TOOL, EXPORT_TASK_STATUS_TOOL, ADD_NOTE_TOOL, UPDATE_NOTE_TOOL, DELETE_NOTE_TOOL, ADD_DEPENDENCY_TOOL, GET_PROMPTS_TOOL, SET_PROMPTS_TOOL, UPDATE_PROMPTS_TOOL, REMOVE_PROMPTS_TOOL, ARCHIVE_COMPLETED_REQUESTS_TOOL, LIST_ARCHIVED_REQUESTS_TOOL, RESTORE_ARCHIVED_REQUEST_TOOL, ], }));
  • Core service method that updates the global prompts configuration in the task data file and saves it, implementing the actual logic called by the tool handler
    public async setPrompts(prompts: Partial<Prompts>) { await this.loadTasks(); const now = new Date().toISOString(); this.data.prompts = { instructions: prompts.instructions, taskPrefix: prompts.taskPrefix, taskSuffix: prompts.taskSuffix, createdAt: this.data.prompts?.createdAt || now, updatedAt: now, }; // Remove undefined values Object.keys(this.data.prompts).forEach(key => { if (this.data.prompts![key as keyof Prompts] === undefined) { delete this.data.prompts![key as keyof Prompts]; } }); await this.saveTasks(); return { status: "prompts_set", prompts: this.data.prompts, message: "Prompts configuration has been updated." }; }

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/pinkpixel-dev/taskflow-mcp'

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