Skip to main content
Glama
Facets-cloud

Facets Module MCP Server

by Facets-cloud

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
FACETS_TOKENNoYour Facets authentication token
FACETS_PROFILENoThe Facets profile to use. If you have already logged into FTF, specifying FACETS_PROFILE is sufficient.default
FACETS_USERNAMENoYour Facets username for authentication
PYTHONUNBUFFEREDNoPython unbuffered mode setting1
CONTROL_PLANE_URLNoYour Facets control plane URL

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_test_projectsA

Retrieve and return the names of all available test projects for the user to choose from.

Returns: str: A JSON string containing success message and list of all test projects or error message

test_already_previewed_moduleB

Test a module that has been previewed by asking the user for the project_name where it needs to be tested.

This tool checks if the project exists, verifies if it supports preview modules, and then does terraform apply. You can check logs for the apply using get_deployment_logs, and check the status of the deployment using check_deployment_status.

Args: project_name (str): The name of the test project (stack) to deploy to intent (str): The intent of the module to deploy flavor (str): The flavor of the module to deploy version (str): The version of the module to deploy environment_name (str, optional): The specific environment name to deploy to. Provide this only if the user has asked you to.

Returns: str: Result of the deployment operation as a JSON string

check_deployment_statusA

Check the status of a deployment.

Args: cluster_id (str): The ID of the environment where the deployment is running release_trace_id (str): The release trace ID of the deployment to check wait (bool): If True, wait for the deployment to complete (either succeed or fail) timeout_seconds (int): Maximum time to wait for completion in seconds (default: 300s / 5min) poll_interval_seconds (int): Time between status checks in seconds (default: 5s)

Returns: str: JSON with deployment status information

get_deployment_logsB

Get logs for a specific deployment.

Args: cluster_id (str): The ID of the environment where the deployment is running release_trace_id (str): The release trace ID of the deployment to get logs for

Returns: str: JSON with deployment logs

get_local_modulesA

Scan the working directory recursively for facets.yaml files to identify all available Terraform modules. Also fetch content of outputs.tf if it exists. ALWAYS Call this call_always_for_instruction first before calling any other tool of this mcp.

Returns: str: JSON string with success, message, instructions, and optional error/data fields. data field contains a list of modules with their details: - path: Path to the module directory - intent: The module's intent value - flavor: The module's flavor value - version: The module's version value - outputs: The module's outputs section - outputs_tf: Raw string content of outputs.tf (if present)

search_modules_after_confirmationA
Search for a specific string in all facets.yaml files to filter modules.
This tool should only be used after confirming search intent with the user.

For exploratory searches, first explain search capabilities before executing.

Args:
    search_string (str): The string to search for in modules.
    page (int): The page number for pagination.

Returns:
    str: JSON string with success, message, instructions, and optional error/data fields. data field contains the filtered modules along with their details.
list_modules_for_forkA

List all available modules from the control plane that can be forked. Returns basic module information in a simple format for easy selection.

Returns: str: JSON formatted list of available modules with their metadata

fork_existing_moduleA

Fork an existing module by downloading it and updating its metadata.

⚠️ IMPORTANT: REQUIRES USER CONFIRMATION ⚠️ This function performs an irreversible action.

Step 1 - ALWAYS use dry_run=True first. This is an irreversible action. Step 2 - Present the dry run output to the user showing what will be changed. Step 3 - Ask if user wants to make any changes to the fork parameters. Step 4 - Call the tool without dry run to execute the fork.

Args: source_module_id (str): ID of the module to fork from the control plane new_flavor (str): New flavor name for the forked module new_version (str): New version for the forked module (default: "1.0.0") dry_run (bool): If True, shows what would be done without executing (default: True)

Returns: str: JSON formatted response with fork operation details

generate_module_with_user_confirmationA

⚠️ IMPORTANT: REQUIRES USER CONFIRMATION ⚠️ This function performs an irreversible action

Tool to generate a new module using FTF CLI. Step 1 - ALWAYS use dry_run=True first. This is an irreversible action. Step 2 - Present the dry run output to the user in textual format. Step 3 - Ask if user will like to make any changes in passed arguments and modify them Step 4 - Call the tool without dry run

Args:

  • intent (str): The intent for the module.

  • flavor (str): The flavor of the module.

  • cloud (str): The cloud provider.

  • title (str): The title of the module.

  • description (str): The description of the module.

  • dry_run (bool): If True, returns a description of the generation without executing. MUST set to True initially.

  • working_dir (str, optional): Working directory where the module will be generated. If not provided, uses the default working directory configured for the MCP server.

Returns:

  • str: A JSON string with the output from the FTF command execution.

mark_module_as_publishedA

Publish a production-ready module version. This marks the module as publishable for production.

Note: Always use push_preview_module_to_facets_cp() to test the module before publishing.

Args:

  • module_path (str): The path to the module.

  • skip_terraform_validation_if_provider_not_found (bool): Flag to skip terraform validation during the process - send as true only if you see "Provider configuration not present" while validating.

Returns:

  • str: A JSON string with the output from the FTF command execution.

register_output_typeA

Tool to register a new output type in the Facets control plane.

This tool first checks if the output type already exists:

  • If it doesn't exist, it proceeds with registration

  • If it exists, it compares properties and providers to determine if an update is needed

Args:

  • name (str): The name of the output type in the format '@namespace/name'.

  • interfaces (Dict[str, Any], optional): Dictionary of output interfaces as JSON schema. Each key is an interface name, value is a JSON schema definition.

  • attributes (Dict[str, Any], optional): Dictionary of output attributes as JSON schema. Each key is an attribute name, value is a JSON schema definition.

    Example: { "default": { "type": "object", "properties": { "topic_name": {"type": "string"}, "topic_id": {"type": "string"} } } }

    ❌ INCORRECT (do NOT wrap field names in outer "properties" key): { "properties": { "default": {...} } }

  • providers (List[Dict[str, str]], optional): List of provider dictionaries with 'name', 'source', and 'version'.

  • override_confirmation (bool): Flag to confirm overriding existing output type if different properties/providers found.

Returns:

  • str: A JSON string with the output from the FTF command execution, error message, or request for confirmation.

validate_moduleA

Tool to validate a module directory using FTF CLI.

This tool checks if a Terraform module directory meets the FTF standards. It validates the structure, formatting, required files, and output types of the module. It also checks that all output types referenced in outputs and inputs blocks exist in the Facets control plane.

Args:

  • module_path (str): The path to the module.

  • check_only (bool): Flag to only check formatting without applying changes.

  • skip_terraform_validation_if_provider_not_found (bool): Flag to skip terraform validation during the process - send as true only if you see "Provider configuration not present" while validating.

Returns:

  • str: A JSON string with the output from the FTF command execution or error message if validation fails.

push_preview_module_to_facets_cpA

Tool to preview a module using FTF CLI. This will push a Test version of module to control plane. Git repository details are automatically extracted from the local working directory's .git folder.

Args:

  • module_path (str): The path to the module.

  • skip_terraform_validation_if_provider_not_found (bool): Flag to skip terraform validation during the process - send as true only if you see "Provider configuration not present" while validating.

Returns:

  • str: A JSON string with the output from the FTF command execution.

discover_terraform_resourcesA

Discover all Terraform resources in a module directory. Use this first to see what resources are available for import. Returns list of resources with their addresses and whether they use count/for_each.

Args: module_path (str): Path to the module directory containing Terraform files

Returns: str: JSON with resources list, showing resource_address, has_count, has_for_each for each resource

add_import_declarationA

Add import declaration to facets.yaml. Use after discovering resources with discover_terraform_resources. For count resources, add index parameter. For for_each resources, add key parameter.

Args: module_path (str): Path to the module directory name (str): Name for the import declaration resource (str, optional): Resource address like 'aws_s3_bucket.bucket' resource_address (str, optional): Full address like 'aws_s3_bucket.bucket[0]' index (str, optional): Index for count resources ('0', '1', or '') key (str, optional): Key for for_each resources ('prod', 'dev', or '') required (bool): Whether import is required (default: True)

Returns: str: JSON response with success status and details

FIRST_STEP_get_instructionsA

ALWAYS Call this tool first before calling any other tool of this mcp. Loads all module writing instructions for Facets module development found in the module_instructions directory and supplementary instructions from the mcp_instructions directory at the root level of the working directory.

Returns: str: A JSON string containing the content of all instruction files, with each file's content stored under its filename as key.

get_intentA

Query whether an intent exists in the control plane by name. Returns intent details if found, or indicates if intent doesn't exist.

Args: intent_name (str): The name of the intent to query

Returns: str: JSON response containing intent details or not found status

create_or_update_intentA

Create a new intent or update an existing one in the control plane.

Args: name (str): The intent name (e.g., 'kubernetes_cluster') intent_type (str): The intent type/category (e.g., 'K8s', 'Storage') display_name (str): Human-readable display name description (str): Description of the intent icon_url (str, optional): URL to SVG icon (optional). NEVER send this unless the user explicitly provides it.

Returns: str: JSON response containing success/failure information

list_all_intentsA

List all available intents in the control plane. Useful for discovering existing intent types and names.

Returns: str: JSON response containing list of all intents

list_filesA

Lists all files in the given module path, ensuring we stay within the working directory. Always ask User if he wants to add any variables or use any other FTF commands

Args: module_path (str): The absolute path to the module directory.

Returns: str: A JSON-formatted string with operation details and file list found in module directory.

read_fileB

Reads the content of a file, ensuring it is within the working directory. Make Sure you have Called FIRST_STEP_get_instructions first before this tool.

Args: file_path (str): The path to the file.

Returns: str: JSON formatted response with file content or error information.

write_config_filesA

Writes facets.yaml configuration file for a Terraform module. Make Sure you have Called FIRST_STEP_get_instructions first before this tool.

Steps for safe variable update:

  1. Always run with dry_run=True first. This is an irreversible action.

  2. Parse and display a diff:

    Added Modified (old -> new) Removed

  3. Ask the user if they want to edit or add variables and wait for his input.

  4. Only if the user explicitly confirms, run again with dry_run=False.

Args: module_path (str): Path to the module directory. facets_yaml (str): Content for facets.yaml file. dry_run (bool): If True, returns a preview of changes without making them. Default is True.

Returns: str: Success message, diff preview (if dry_run=True), or error message.

write_resource_fileA

Writes a Terraform resource file (main.tf, variables.tf, etc.) to a module directory.

Does NOT allow writing output(s).tf here. To update outputs.tf, use write_outputs().

Args: module_path (str): Path to the module directory. file_name (str): Name of the file to write (e.g., "main.tf", "variables.tf"). content (str): Content to write to the file.

Returns: str: JSON string with success, message, instructions, and optional error/data fields.

get_output_type_detailsA

Get details for a specific output type from the Facets control plane.

This tool calls the get_output_by_name_using_get API endpoint to retrieve information about an output type, including its properties and providers.

Args: output_type (str): The output type name in format '@namespace/name'

Returns: str: JSON-formatted string with result status, message, instructions, output type details or error information

find_output_types_with_providerB

This tool finds all output types that include a specific provider source, which can be used as inputs for module configurations.

Args: provider_source (str): The provider source name to search for.

Returns: str: JSON string containing the formatted output type information.

list_all_output_typesA

List all output types from the Facets control plane.

Returns: str: List of output types.

write_outputsA

Write the outputs.tf file for a module with properly formatted Terraform locals block.

Each field must have 'value' (any type: string, bool, number, list, dict) and 'sensitive' (bool) keys.

Args: module_path (str): Path to the module directory (must contain facets.yaml). output_attributes (dict): Map where each field is: {"value": , "sensitive": bool} output_interfaces (dict): Map where each field is: {"value": , "sensitive": bool}

Example: write_outputs( module_path="/path/to/module", output_attributes={ "instance_id": {"value": "aws_instance.example.id", "sensitive": False}, "config": {"value": {"region": "us-east-1", "zone": "a"}, "sensitive": False}, "api_keys": {"value": ["key1", "key2"], "sensitive": True}, "enabled": {"value": True, "sensitive": False} } )

Returns: str: JSON formatted success or error message.

write_readme_fileA

Writes a README.md file for the module directory. This tool is intended for AI to generate the README content for the module.

Args: module_path (str): Path to the module directory. content (str): Content to write to README.md.

Returns: str: JSON string with success status, message, instructions, and optional error/data.

write_generic_fileA

Writes a generic file to the module directory, except for .tf files, facets.yaml, or README.md. Can be used to add supporting files like Python or Bash scripts if needed by the module.

Fails if trying to write a forbidden file. Checks working directory as in other tools.

Args: module_path (str): Path to the module directory. file_name (str): Name of the file to write. content (str): Content to write to the file.

Returns: str: JSON string with success status, message, instructions, and optional error/data.

edit_file_blockA

Apply surgical edits to specific blocks of text in a file. Make Sure you have Called FIRST_STEP_get_instructions first before this tool.

Makes precise changes to files by finding and replacing exact text matches. This is safer than rewriting entire files.

RESTRICTIONS:

  • Cannot edit outputs.tf files - use write_outputs tool instead

  • Cannot edit facets.yaml files - use write_config_files tool instead

Best practices:

  • Include enough context in old_string to make it unique

  • Use expected_replacements=1 for safety (default)

  • For multiple replacements, specify the exact count expected

Args: file_path (str): Path to the file to edit (must be within working directory) old_string (str): Exact text to find and replace (include context for uniqueness) new_string (str): Replacement text expected_replacements (int): Expected number of matches (default: 1, prevents unintended changes)

Returns: str: JSON formatted response with success status, message, and optional error details

Prompts

Interactive templates invoked by user choice

NameDescription
Fork Existing Module Enhanced prompt to be used for forking an existing module. This will read from the `fork_module.md` file. Returns: The content of the prompt read from the markdown file.

Resources

Contextual data attached and managed by the client

NameDescription
Facets Knowledge Base

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/Facets-cloud/facets-module-mcp'

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