Skip to main content
Glama

Get Workflow Preferences

get_workflow_preferences

Load user workflow preferences from past sessions to restore previous settings and streamline project management tasks.

Instructions

Load user workflow preferences from past sessions. No auth needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for get_workflow_preferences. Checks for .pm_preferences.json file, reads and parses it, tags observations with USER_DATA wrapper, and returns results. Handles errors via try-catch with error formatting.
    async () => {
      try {
        if (!existsSync(PREFS_PATH)) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(finalizeToolResult({ found: false, preferences: [] })),
              },
            ],
          };
        }
        const data = JSON.parse(readFileSync(PREFS_PATH, "utf-8"));
        const raw = data.observations ?? [];
        const prefs = raw.map((p: unknown) => (typeof p === "string" ? tagUserText(p) : p));
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(finalizeToolResult({ found: true, preferences: prefs })),
            },
          ],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(finalizeToolResult(handleError(err))),
            },
          ],
        };
      }
    },
  • src/tools/pm.ts:45-86 (registration)
    Tool registration with MCP server. Defines tool name, title, description, input schema (empty object since no parameters needed), and associates the handler function. Called from registerPmTools().
    server.registerTool(
      "get_workflow_preferences",
      {
        title: "Get Workflow Preferences",
        description: "Load user workflow preferences from past sessions. No auth needed.",
        inputSchema: z.object({}),
      },
      async () => {
        try {
          if (!existsSync(PREFS_PATH)) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify(finalizeToolResult({ found: false, preferences: [] })),
                },
              ],
            };
          }
          const data = JSON.parse(readFileSync(PREFS_PATH, "utf-8"));
          const raw = data.observations ?? [];
          const prefs = raw.map((p: unknown) => (typeof p === "string" ? tagUserText(p) : p));
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(finalizeToolResult({ found: true, preferences: prefs })),
              },
            ],
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(finalizeToolResult(handleError(err))),
              },
            ],
          };
        }
      },
    );
  • Input schema definition using Zod. Empty object schema indicates the tool takes no input parameters.
    inputSchema: z.object({}),
  • Local helper function to format errors. Converts CliError or unexpected errors into contract error format using contractError utility.
    function handleError(err: unknown): Record<string, unknown> {
      if (err instanceof CliError) return contractError(String(err), "error");
      return contractError(`Unexpected error: ${err}`, "error");
    }
  • Helper function that tags user-provided text with USER_DATA wrapper for security tracking. Used to wrap each observation preference before returning.
    export function tagUserText(text: string | null | undefined): string | null {
      if (text == null) return null;
      return `[USER_DATA]${text}[/USER_DATA]`;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that no authentication is needed, which is useful behavioral context, but it lacks details on rate limits, error handling, or what 'Load' entails (e.g., format, scope). It does not contradict annotations, as there are none.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with zero waste, front-loaded with the core purpose and followed by a key behavioral note. Every word earns its place, making it highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 0 parameters, the description is minimal but covers the basics: purpose and an auth note. However, for a tool that loads preferences, it lacks details on return values, data format, or potential side effects, leaving gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add param info, which is acceptable here, but it could have mentioned any implicit parameters (none exist), keeping it slightly below perfect.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Load' and resource 'user workflow preferences from past sessions', making the purpose specific. However, it does not explicitly differentiate from sibling tools like 'save_workflow_preferences' or other get/list tools, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some context with 'No auth needed', implying usage when authentication is not required, but it does not specify when to use this tool versus alternatives like 'get_account' or other preference-related tools. Usage is implied rather than explicitly guided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/rangogamedev/codecks-mcp'

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