Skip to main content
Glama
Infisical

Infisical MCP Server

Official
by Infisical

list-secrets

Retrieve and display all secrets within a specified project and environment in Infisical. Supports custom paths, expanded references, and included imports for comprehensive secret management.

Instructions

List all secrets in a given Infisical project and environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentSlugYesThe slug of the environment to list the secrets from (required)
expandSecretReferencesNoWhether to expand secret references (Defaults to true)
includeImportsNoWhether to include secret imports (Defaults to true)
projectIdYesThe ID of the project to list the secrets from (required)
secretPathNoThe path of the secrets to list (Defaults to /)

Implementation Reference

  • Handler for the 'list-secrets' tool. Parses input, calls infisicalSdk.secrets().listSecrets(), processes secrets and imports, and returns formatted JSON response.
    if (name === AvailableTools.ListSecrets) {
    	const data = listSecretsSchema.zod.parse(args);
    
    	const secrets = await infisicalSdk.secrets().listSecrets({
    		environment: data.environmentSlug,
    		projectId: data.projectId,
    		secretPath: data.secretPath,
    		expandSecretReferences: data.expandSecretReferences,
    		includeImports: data.includeImports
    	});
    
    	const response = {
    		secrets: secrets.secrets.map(secret => ({
    			secretKey: secret.secretKey,
    			secretValue: secret.secretValue
    		})),
    		...(secrets.imports && {
    			imports: secrets.imports?.map(imp => {
    				const parsedImportSecrets = imp.secrets.map(secret => ({
    					secretKey: secret.secretKey,
    					secretValue: secret.secretValue
    				}));
    
    				return {
    					...imp,
    					secrets: parsedImportSecrets
    				};
    			})
    		})
    	};
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: `${JSON.stringify(response)}`
    			}
    		]
    	};
    }
  • Schema definition for 'list-secrets' tool, including Zod validator and capability metadata with inputSchema.
    const listSecretsSchema = {
    	zod: z.object({
    		projectId: z.string(),
    		environmentSlug: z.string(),
    		secretPath: z.string().default("/"),
    		expandSecretReferences: z.boolean().default(true),
    		includeImports: z.boolean().default(true)
    	}),
    	capability: {
    		name: AvailableTools.ListSecrets,
    		description: "List all secrets in a given Infisical project and environment",
    		inputSchema: {
    			type: "object",
    			properties: {
    				projectId: {
    					type: "string",
    					description: "The ID of the project to list the secrets from (required)"
    				},
    				environmentSlug: {
    					type: "string",
    					description: "The slug of the environment to list the secrets from (required)"
    				},
    				secretPath: {
    					type: "string",
    					description: "The path of the secrets to list (Defaults to /)"
    				},
    				expandSecretReferences: {
    					type: "boolean",
    					description: "Whether to expand secret references (Defaults to true)"
    				},
    				includeImports: {
    					type: "boolean",
    					description: "Whether to include secret imports (Defaults to true)"
    				}
    			},
    			required: ["projectId", "environmentSlug"]
    		}
    	}
    };
  • src/index.ts:452-467 (registration)
    Registration of all tools including 'list-secrets' via the ListToolsRequestSchema handler, where listSecretsSchema.capability is included in the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
    	return {
    		tools: [
    			createSecretSchema.capability,
    			deleteSecretSchema.capability,
    			updateSecretSchema.capability,
    			listSecretsSchema.capability,
    			getSecretSchema.capability,
    			createProjectSchema.capability,
    			createEnvironmentSchema.capability,
    			createFolderSchema.capability,
    			inviteMembersToProjectSchema.capability,
    			listProjectsSchema.capability
    		]
    	};
    });
  • src/index.ts:57-68 (registration)
    Enum defining tool names, including ListSecrets = "list-secrets" used throughout for matching.
    enum AvailableTools {
    	CreateSecret = "create-secret",
    	DeleteSecret = "delete-secret",
    	UpdateSecret = "update-secret",
    	ListSecrets = "list-secrets",
    	GetSecret = "get-secret",
    	CreateProject = "create-project",
    	CreateEnvironment = "create-environment",
    	CreateFolder = "create-folder",
    	InviteMembersToProject = "invite-members-to-project",
    	ListProjects = "list-projects"
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it's a list operation (implied read-only) but doesn't disclose behavioral traits like pagination, rate limits, authentication requirements, error handling, or what 'list all' entails (e.g., completeness guarantees). The description is minimal and lacks critical operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('List all secrets') and specifies scope. There is zero waste, and every word earns its place by clarifying the tool's purpose concisely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 5 parameters (though well-documented in schema), the description is incomplete. It lacks details on return values (e.g., format, structure), error cases, or operational constraints, making it inadequate for a tool that likely returns complex data in a security-sensitive context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no additional meaning beyond implying project/environment context, matching the baseline score for high schema coverage without extra param insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('secrets'), specifying scope ('in a given Infisical project and environment'). It distinguishes from siblings like 'get-secret' (single secret) and 'create-secret' (write operation), but doesn't explicitly contrast with other list-like tools (none exist in siblings).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites (e.g., authentication), compare to 'get-secret' for single secrets, or indicate scenarios like bulk retrieval. Usage is implied by the name but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/Infisical/infisical-mcp-server'

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