Skip to content

Conversation

@jhb-dev
Copy link
Contributor

@jhb-dev jhb-dev commented Dec 15, 2025

What

Adds depth parameter support to MCP resource tools (find and create), allowing MCP clients to control relationship population depth when querying or creating documents.

Why

MCP clients currently have no way to control how deeply relationships are populated when retrieving or creating documents. When collections have relationship fields, agents need the ability to either:

  • Get just the IDs (depth=0) for lightweight responses
  • Get fully populated relationship data (depth=1+) for richer context

This can significantly reduce the token count when reading documents.

How

  • Added depth parameter to findResources and createResource schemas in schemas.ts
  • Updated find.ts to pass depth to both payload.find() and payload.findByID() calls
  • Updated create.ts to pass depth to payload.create() call
  • Parameter is an optional integer (0-10) with default of 0
  • Added integration tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant