Skip to main content
Glama

tasks_setup

Initialize task management by creating or loading a source file from a specified path to enable task tracking and organization capabilities.

Instructions

Initializes an source file from a path

  • Always call once per conversation when asked to use these tools

  • Ask the user to clarify the file path if not given, before calling this tool

  • Creates the file if it does not exist

  • Returns the source ID for further use

  • Use mcp-tasks tools when the user mentions new or updated tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNoWorkspace/project directory path (provided by the IDE or use $PWD)
source_pathYes

Implementation Reference

  • Core handler logic for the 'tasks_setup' tool (prefixed name for internal 'setup' tool). Parses the source file, registers it using sources.register, and returns a JSON summary via getSummary.
    handler: (args) => {
      storage.getParser(args.source_path)
      // Register the source and get ID
      const source = sources.register(args.source_path, args.workspace)
      return getSummary(source.id)
    },
  • Zod input schema definition for the tasks_setup tool, including workspace (optional) and source_path.
    schema: z.object({
      workspace: z.string().optional().describe('Workspace/project directory path (provided by the IDE or use $PWD)'),
      source_path: schemas.sourcePath,
    }),
  • src/server.ts:15-42 (registration)
    Registration loop in MCP server that adds all tools from tools.ts (including tasks_setup) to the FastMCP server instance.
    // Register all tools & resources
    for (const tool of Object.values(tools)) {
      if (!tool.isEnabled) {
        continue
      }
      if (tool.isResource) {
        // Register as resource
        server.addResource({
          uri: `resource://${tool.name}`,
          name: tool.description,
          mimeType: 'text/plain',
          load: () => cli.runTool(tool, []).then(text => ({ text })),
        })
      } else {
        // Register as tool with enhanced logging
        server.addTool({
          annotations: {
            openWorldHint: false, // This tool doesn't interact with external systems
            readOnlyHint: tool.isReadOnly,
            title: tool.name,
          },
          name: tool.name,
          description: tool.description,
          parameters: tool.schema,
          execute: (args) => cli.runTool(tool, args),
        })
      }
    }
  • defineTool helper that wraps the tool definition, sets the name to 'tasks_setup' based on env.PREFIX_TOOLS, and adds default properties.
    function defineTool<S extends ZodSchema>(name: string, tool: {
      schema: S
      description: string
      isResource?: boolean
      isReadOnly?: boolean
      isEnabled?: boolean
      handler: (args: z.infer<S>, context?: any) => any
      fromArgs: (args: string[]) => z.infer<S>
    }) {
      const toolName = env.PREFIX_TOOLS ? `tasks_${name}` : name
      return {
        ...tool,
        name: toolName,
        isResource: tool.isResource ?? false,
        isReadOnly: tool.isReadOnly ?? false,
        isEnabled: tool.isEnabled ?? true,
      }
    }
  • sources.register helper called by tasks_setup handler to register the source file path (making absolute if needed) and persist to SOURCES_PATH, returning the Source object with ID.
    register(sourcePath: string, workspace = CWD): Source {
      let path = sourcePath
      if (!isAbsolute(path)) {
        if (!workspace) {
          throw new Error('You must specify a workspace directory when registering a relative path.')
        }
        path = util.resolve(path, workspace)
      }
      const list = sources.raw()
      // Remove if exists and add to front (LIFO)
      const filtered = list.filter(s => s.path !== path)
      const source: SourceRaw = { path, workspace }
      util.writeFile(SOURCES_PATH, JSON.stringify([source, ...filtered]))
      return sources.fromRaw(source)
    },
Behavior4/5

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

Annotations indicate readOnlyHint=false and openWorldHint=false, implying a write operation with limited scope. The description adds valuable behavioral context beyond annotations: it specifies that the tool creates the file if it doesn't exist, returns a source ID for further use, and should be called once per conversation. This provides practical guidance on side effects and usage patterns, though it doesn't detail error handling or permissions.

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 well-structured with bullet points, making it easy to scan. Each sentence adds value: the first states the purpose, followed by specific usage rules and behavioral notes. There is no redundant information, and it's front-loaded with the core action, making it highly efficient and clear.

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

Completeness4/5

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

Given the tool's complexity (initialization with file creation) and lack of output schema, the description does a good job covering key aspects: purpose, usage guidelines, behavioral traits, and return value (source ID). It doesn't explain error cases or detailed output format, but with annotations providing safety hints and the description adding practical context, it's mostly complete for agent use.

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

Parameters3/5

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

Schema description coverage is 50% (only 'workspace' has a description). The description mentions 'source file from a path' and 'file path,' which aligns with the 'source_path' parameter, adding some meaning. However, it doesn't explain the 'workspace' parameter or provide details beyond the schema's minimal coverage. With partial schema documentation, the description compensates slightly but not fully, meeting the baseline.

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 tool's purpose: 'Initializes an source file from a path' and 'Creates the file if it does not exist.' It specifies the verb ('initializes'), resource ('source file'), and action ('creates if not exist'). However, it doesn't explicitly differentiate from sibling tools like tasks_add or tasks_update, which might also involve file operations, so it's not a perfect 5.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: 'Always call once per conversation when asked to use these tools,' 'Ask the user to clarify the file path if not given, before calling this tool,' and 'Use mcp-tasks tools when the user mentions new or updated tasks.' It clearly states when to use this tool (initial setup) and includes prerequisites (clarify path if missing), making it highly actionable.

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/flesler/mcp-tasks'

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