Skip to content

feat(mcp): improve project context awareness in MCP tool descriptions #273

@leggetter

Description

@leggetter

Problem

When an AI agent is asked to query a specific Hookdeck project by name (e.g. "is everything healthy in my Hookdeck Prod / Default Project?"), it does not automatically verify or switch to the correct project before running queries. Instead, it silently uses whatever project happens to be active, returning results from the wrong project without any warning.

The root cause is that the MCP tool descriptions don't signal to the agent that:

  1. All queries are scoped to an active project
  2. The active project must be verified/switched before running any queries
  3. hookdeck_projects should be called first when a project name is mentioned

Proposed Changes

hookdeck_projects description

Add imperative language to make this the required first step when a project is referenced:

Always call this first when the user references a specific project by name. List available projects to find the matching project ID, then use the use action to switch to it before calling any other tools. All queries (events, issues, connections, metrics, requests) are scoped to the active project — if the wrong project is active, all results will be wrong. Also use this when unsure which project is currently active.

hookdeck_issues, hookdeck_events, hookdeck_connections, hookdeck_metrics, hookdeck_requests descriptions

Append the following note to each:

Results are scoped to the active project — call hookdeck_projects first if the user has specified a project.

hookdeck_help description

Append:

Note: all tools operate on the active project — use hookdeck_projects to verify or switch project context before querying.

Additional Consideration

Consider including the active project name/ID in the response envelope of all query tools, e.g.:

{
  "project": { "id": "tm_abc123", "name": "Hookdeck Prod / Default Project" },
  "models": [...],
  "pagination": {...}
}

This would allow agents to self-correct even after running a query — noticing the returned project doesn't match the user's intent and re-running against the correct one.

Impact

Without these changes, agents will silently return data from the wrong project whenever the active project doesn't match the one the user asked about, with no indication that anything is wrong. This is a correctness issue that degrades trust in agent-driven workflows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions