Skip to main content
Glama
hald

Things MCP Server

by hald

get_headings

Extract headings from projects in Things app using a specified project UUID. Simplify task organization and project analysis by retrieving structured data for better workflow management.

Instructions

Get headings from Things

Args: project_uuid: Optional UUID of a specific project to get headings from

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_uuidNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_headings' tool, decorated with @mcp.tool which also handles registration. Fetches headings (tasks of type 'heading') from Things database, optionally filtered by project UUID, formats them, and returns a string.
    @mcp.tool
    async def get_headings(project_uuid: str = None) -> str:
        """Get headings from Things
        
        Args:
            project_uuid: Optional UUID of a specific project to get headings from
        """
        if project_uuid:
            project = things.get(project_uuid)
            if not project or project.get('type') != 'project':
                return f"Error: Invalid project UUID '{project_uuid}'"
            headings = things.tasks(type='heading', project=project_uuid)
        else:
            headings = things.tasks(type='heading')
        
        if not headings:
            return "No headings found"
        
        from formatters import format_heading
        formatted_headings = [format_heading(heading) for heading in headings]
        return "\n\n---\n\n".join(formatted_headings)
  • Helper function used by get_headings to format each heading into a readable string, including title, UUID, project, dates, notes, and optionally subtasks.
    def format_heading(heading: dict, include_items: bool = False) -> str:
        """Helper function to format a single heading."""
        heading_text = f"Title: {heading['title']}\nUUID: {heading['uuid']}"
        heading_text += f"\nType: heading"
        
        # Add project info if present
        if heading.get('project'):
            if heading.get('project_title'):
                heading_text += f"\nProject: {heading['project_title']}"
            else:
                try:
                    project = things.get(heading['project'])
                    if project:
                        heading_text += f"\nProject: {project['title']}"
                except Exception:
                    pass
        
        # Add dates
        if heading.get('created'):
            heading_text += f"\nCreated: {heading['created']}"
        if heading.get('modified'):
            heading_text += f"\nModified: {heading['modified']}"
            
        # Add notes if present
        if heading.get('notes'):
            heading_text += f"\nNotes: {heading['notes']}"
            
        if include_items:
            # Get todos under this heading
            todos = things.todos(heading=heading['uuid'])
            if todos:
                heading_text += "\n\nTasks under heading:"
                for todo in todos:
                    heading_text += f"\n- {todo['title']}"
        
        return heading_text
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' data, implying a read-only operation, but lacks details on permissions, rate limits, return format, or any side effects. This is inadequate for a tool with no annotation coverage.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: one stating the purpose and another explaining the parameter. It's front-loaded with the main action, though the 'Args:' section could be integrated more smoothly, but overall it's efficient with minimal waste.

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 the tool has an output schema (which handles return values) and low complexity with one optional parameter, the description is somewhat complete but lacks behavioral context due to no annotations. It covers the basic purpose and parameter semantics but misses usage guidelines and transparency details, making it minimally adequate.

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 0%, so the description must compensate. It adds meaning by explaining that 'project_uuid' is optional and specifies it's for 'a specific project to get headings from', clarifying the parameter's purpose beyond the schema's basic type. However, it doesn't detail format (e.g., UUID structure) or default behavior when omitted, leaving some gaps.

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 'Get' and resource 'headings from Things', which is specific and actionable. However, it doesn't differentiate from sibling tools like 'get_projects' or 'get_todos' that also retrieve data from the same system, missing explicit distinction.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives such as 'get_projects' or 'search_items'. The description only mentions an optional parameter without context on appropriate use cases or exclusions, leaving the agent to infer usage.

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

Related 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/hald/things-mcp'

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