Skip to content

feat(search_modules): Add pagination limit and filter parameters to reduce API costs#271

Open
sks wants to merge 1 commit intohashicorp:mainfrom
sks:feature/search_modules_limits
Open

feat(search_modules): Add pagination limit and filter parameters to reduce API costs#271
sks wants to merge 1 commit intohashicorp:mainfrom
sks:feature/search_modules_limits

Conversation

@sks
Copy link

@sks sks commented Feb 4, 2026

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

Summary

This PR adds pagination and filtering parameters to the search_modules tool to reduce API costs and improve search efficiency.

Problem

Each module search was returning all matching results, leading to expensive API calls due to large response payloads.

Changes

Added the following parameters to search_modules:

Parameter Type Default Description
limit int 10 (max: 100) Maximum number of results to return
provider string - Filter to a specific provider (e.g., aws, google, azurerm)
namespace string - Filter to a specific namespace
verified bool false If true, only return verified partner modules

Impact

  • Reduced API costs: Default limit of 10 results significantly reduces response payload size
  • Targeted searches: Filters enable more precise queries, further reducing unnecessary data transfer
  • Pagination support: Combined with existing current_offset, enables efficient paging through large result sets

API Reference

These parameters are supported by the Terraform Registry API.

@sks sks requested a review from a team as a code owner February 4, 2026 05:58
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Feb 4, 2026

CLA assistant check
All committers have signed the CLA.

@sks sks force-pushed the feature/search_modules_limits branch from 1436f2d to a246b6a Compare February 4, 2026 05:59
@sks
Copy link
Author

sks commented Feb 6, 2026

@jrhouston : PTAL, TIA

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant