Skip to main content
Glama
ptorsten

humaans-mcp

by ptorsten

get_direct_reports

List direct reports for an employee by providing their person ID. Useful for understanding reporting relationships.

Instructions

List direct reports of the given person. Reads the directReports array on the person record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
person_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler: fetches the person by ID, reads the directReports array, indexes all people, and returns a list of summaries for each direct report.
    @mcp.tool()
    async def get_direct_reports(person_id: str) -> list[dict[str, Any]]:
        """List direct reports of the given person. Reads the `directReports` array on the person record."""
        person = await client().get(f"/people/{person_id}")
        report_ids = person.get("directReports") or []
        if not report_ids:
            return []
        by_id, _, custom_by_person = await _people_index()
        return [
            _person_summary(by_id[rid], custom_by_person.get(rid))
            for rid in report_ids
            if rid in by_id
        ]
  • Registration via the @mcp.tool() decorator on an async function, registering it with the FastMCP server.
    @mcp.tool()
    async def get_direct_reports(person_id: str) -> list[dict[str, Any]]:
        """List direct reports of the given person. Reads the `directReports` array on the person record."""
        person = await client().get(f"/people/{person_id}")
        report_ids = person.get("directReports") or []
        if not report_ids:
            return []
        by_id, _, custom_by_person = await _people_index()
        return [
            _person_summary(by_id[rid], custom_by_person.get(rid))
            for rid in report_ids
            if rid in by_id
        ]
  • Helper function that formats a person record into a summary dict, used by get_direct_reports to build the response.
    def _person_summary(p: dict[str, Any], custom: dict[str, Any] | None = None) -> dict[str, Any]:
        return {
            **(custom or {}),
            "id": p.get("id"),
            "firstName": p.get("firstName"),
            "lastName": p.get("lastName"),
            "jobTitle": p.get("jobTitle"),
            "email": p.get("email"),
            "contractType": p.get("contractType"),
        }
  • Helper that builds an index of all people (by id), a parent_of mapping, and custom field values per person — used by get_direct_reports to look up direct reports.
    async def _people_index() -> tuple[dict[str, dict[str, Any]], dict[str, str], dict[str, dict[str, Any]]]:
        """Return (by_id, parent_of, custom_by_person). parent_of maps a report's id to their manager's id; custom_by_person maps personId to {fieldName: value}."""
        all_people = await client().list_all("/people")
        by_id = {p["id"]: p for p in all_people if "id" in p}
        parent_of: dict[str, str] = {}
        for p in all_people:
            mgr_id = p.get("id")
            for child_id in p.get("directReports") or []:
                parent_of[child_id] = mgr_id
    
        names = await _custom_field_names()
        all_values = await client().list_all("/custom-values")
        values_by_person: dict[str, list[dict[str, Any]]] = {}
        for v in all_values:
            pid = v.get("personId")
            if pid:
                values_by_person.setdefault(pid, []).append(v)
        custom_by_person = {
            pid: _resolve_custom(vs, names) for pid, vs in values_by_person.items()
        }
    
        return by_id, parent_of, custom_by_person
Behavior4/5

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

The description reveals it reads the 'directReports' array, implying a read-only operation. With no annotations provided, this adds valuable transparency. Could mention if it returns IDs or full person objects, but output schema likely covers that.

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?

Two sentences, front-loaded with the main action. No filler or redundancy.

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 low complexity (1 parameter, no annotations), the description covers the essential purpose. However, it could briefly explain the return format, though an output schema exists.

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

Parameters2/5

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

The schema has 0% description coverage, and the description does not add any semantics to the 'person_id' parameter beyond its name. No format or usage details are provided.

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

Purpose5/5

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

The description clearly states 'List direct reports of the given person' with a specific verb and resource, and distinguishes from sibling tools like 'get_reporting_chain_up/down'.

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 on when to use this tool vs alternatives like 'get_reporting_chain_up/down'. No prerequisites or context provided beyond the required person_id.

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/ptorsten/humaans-mcp'

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