Skip to main content
Glama

get-areas

Retrieve all areas from Things 3 to organize projects and tasks, with an option to include nested items for comprehensive project management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_itemsNoInclude projects and tasks within areas

Implementation Reference

  • Tool registration for "get-areas" and the handler function logic.
    server.tool(
      "get-areas",
      {
        include_items: z.boolean().optional().describe("Include projects and tasks within areas"),
      },
      async ({ include_items }) => {
        const data = await withDatabase((db) => {
          const tasks = getAllTasks(db);
          return getAreas(db, tasks, include_items ?? false);
        });
        return buildTextResponse(`Found ${data.length} areas`, { areas: data });
      }
    );
  • Helper function `getAreas` which executes the actual database logic to fetch and format areas.
    function getAreas(db: DatabaseSync, tasks: TaskRecord[], includeItems = false): AreaRecord[] {
      const rows = db
        .prepare(
          `
          SELECT AREA.uuid, AREA.title
          FROM TMArea AS AREA
          ORDER BY AREA."index"
          `
        )
        .all() as Array<{ uuid: string; title: string }>;
    
      const areaTags = db
        .prepare(
          `
          SELECT AREA_TAG.areas AS area_id, TAG.title AS tag_title
          FROM TMAreaTag AS AREA_TAG
          LEFT JOIN TMTag AS TAG ON TAG.uuid = AREA_TAG.tags
          ORDER BY TAG."index"
          `
        )
        .all() as Array<{ area_id: string; tag_title: string | null }>;
    
      const tagsByArea = new Map<string, string[]>();
      for (const row of areaTags) {
        if (!row.tag_title) continue;
        const current = tagsByArea.get(row.area_id) ?? [];
        current.push(row.tag_title);
        tagsByArea.set(row.area_id, current);
      }
    
      return rows.map((row) => {
        const area: AreaRecord = {
          id: row.uuid,
          title: row.title,
          tags: tagsByArea.get(row.uuid) ?? [],
        };
    
        if (includeItems) {
          area.projects = tasks.filter(
            (task) =>
              task.type === "project" &&
              task.areaId === row.uuid &&
              !task.trashed
          );
          area.todos = tasks.filter(
            (task) =>
              task.type === "to-do" &&
              task.areaId === row.uuid &&
              !task.trashed &&
              !task.projectId
          );
        }
    
        return area;
      });
    }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/soycanopa/SupaThings-MCP'

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