Skip to content

💡 Request - Query Fields within Entry/Reference #107

@leahwithablackcat

Description

@leahwithablackcat

Is your feature request related to a problem? Please describe.
I'm always frustrated when trying to perform meaningful content analysis with the current search_entries tool because it's limited in scope and functionality. Specifically:

  • 3-entry limit: I can only retrieve 3 entries per query, making it impossible to analyze larger datasets or identify patterns across content
  • Restricted search parameters: Only 7 hardcoded parameters are supported, preventing field-based searches, full-text searches, or advanced filtering
  • No content field access: I cannot search within specific fields like fields.title, fields.text, or fields.slug
  • No pattern matching: Missing operators like [match], [exists], [gte], [lte] that are available in the Contentful API
  • No bulk operations: Cannot search by multiple entry IDs or perform batch analysis

This limits real-world content management workflows. For example, when I needed to analyze our 277 testimonial entries for duplicates, the current tool made this task nearly impossible, requiring hundreds of individual queries.

Describe the solution you'd like
I would like the search_entries tool enhanced to support the full flexibility of the Contentful Management API with these specific improvements:

  1. Increased result limits: Raise the maximum from 3 to 100 entries per query (with configurable default of 10)

  2. Flexible query parameters: Support ANY Contentful API query parameter via a catchall(z.any()) schema, including:

    • Field-based searches: fields.title, fields.slug, fields.text
    • Pattern matching: fields.title[match], fields.slug[exists]
    • System field searches: sys.id[in], sys.createdAt[gte], sys.updatedAt[lte]
    • Metadata filtering: metadata.tags.sys.id[in]
    • Full-text search: query parameter for content-wide searches
  3. Backward compatibility: All existing parameters and functionality remain unchanged

  4. Enhanced TypeScript support: Proper typing for common field searches while maintaining flexibility

Example of desired functionality:

// Search for duplicate testimonials
{
  query: {
    content_type: "testimonial",
    "fields.text": "ZoomInfo serves as the foundation",
    limit: 50
  }
}

// Find entries missing required fields
{
  query: {
    content_type: "blogPost",
    "fields.slug[exists]": false,
    limit: 100
  }
}

// Date-based content analysis
{
  query: {
    "sys.createdAt[gte]": "2025-01-01T00:00:00Z",
    "sys.createdAt[lte]": "2025-01-31T23:59:59Z",
    limit: 100
  }
}

Describe alternatives you've considered

  1. Multiple API calls: Making hundreds of individual 3-entry queries, but this is inefficient and hits rate limits
  2. Direct Contentful API: Bypassing the MCP server entirely, but this defeats the purpose of having an MCP integration
  3. Custom MCP server: Building our own server, but we'd prefer to contribute to the official version
  4. Third-party tools: Using external content analysis tools, but they lack the MCP integration benefits

I actually implemented these enhancements in a working version that maintains full backward compatibility and follows the existing code patterns. The implementation uses:

  • catchall(z.any()) for flexible parameter support
  • Configurable limits with Math.min(args.query.limit || 10, 100)
  • Comprehensive TypeScript typing for common use cases
  • Same error handling and response patterns as existing code

Additional context
This enhancement would unlock powerful content management workflows that are currently impossible:

  • Content auditing: Analyze large datasets for quality issues, missing fields, or inconsistencies
  • Duplicate detection: Identify duplicate content across hundreds of entries
  • Bulk analysis: Process content in meaningful batch sizes for insights
  • Advanced filtering: Use the full power of Contentful's query capabilities

Real-world impact: With these enhancements, I was able to analyze 277 testimonial entries and identify 200+ duplicates across 25+ clusters - a task that would have required 93+ individual queries with the current 3-entry limit.

Implementation readiness: I have a fully working implementation that I'd be happy to contribute via pull request if the maintainers are interested. The code maintains backward compatibility, follows existing patterns, and includes comprehensive TypeScript support.

As a Contentful customer, these limitations have been significant barriers to effective content management. I believe these enhancements would benefit the entire MCP community working with Contentful content at scale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions