Skip to main content
Glama
r-huijts
by r-huijts

list_configs

Retrieve all configurations in your Portkey organization, including their status and workspace associations.

Instructions

Retrieve all configurations in your Portkey organization, including their status and workspace associations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function for the 'list_configs' MCP tool. It invokes PortkeyService.listConfigs() and formats the response data into a standardized MCP text content block with pretty-printed JSON.
    async () => {
      try {
        const configs = await portkeyService.listConfigs();
        return {
          content: [{ 
            type: "text", 
            text: JSON.stringify({
              success: configs.success,
              configurations: configs.data.map(config => ({
                id: config.id,
                name: config.name,
                slug: config.slug,
                workspace_id: config.workspace_id,
                status: config.status,
                is_default: config.is_default,
                created_at: config.created_at,
                last_updated_at: config.last_updated_at,
                owner_id: config.owner_id,
                updated_by: config.updated_by
              }))
            }, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{ 
            type: "text", 
            text: `Error fetching configurations: ${error instanceof Error ? error.message : 'Unknown error'}`
          }]
        };
      }
    }
  • Core helper method in PortkeyService that performs the HTTP GET request to the Portkey API endpoint '/configs' to retrieve the list of configurations, including error handling and type assertion.
    async listConfigs(): Promise<ListConfigsResponse> {
      try {
        const response = await fetch(`${this.baseUrl}/configs`, {
          method: 'GET',
          headers: {
            'x-portkey-api-key': this.apiKey,
            'Accept': 'application/json'
          }
        });
    
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
    
        return await response.json() as ListConfigsResponse;
      } catch (error) {
        console.error('PortkeyService Error:', error);
        throw new Error('Failed to fetch configurations from Portkey API');
      }
    }
  • TypeScript interface defining the expected response structure from the Portkey listConfigs API, consisting of a success flag and an array of Config objects.
    interface ListConfigsResponse {
      success: boolean;
      data: Config[];
    }
  • TypeScript interface defining the structure of individual configuration objects returned in the listConfigs response.
    interface Config {
      id: string;
      name: string;
      slug: string;
      organisation_id: string;
      workspace_id: string;
      is_default: number;
      status: string;
      owner_id: string;
      updated_by: string;
      created_at: string;
      last_updated_at: string;
    }
  • src/index.ts:187-223 (registration)
    MCP server tool registration for 'list_configs', specifying the tool name, description, empty input schema (no parameters required), and references the handler function.
    server.tool(
      "list_configs",
      "Retrieve all configurations in your Portkey organization, including their status and workspace associations",
      {},
      async () => {
        try {
          const configs = await portkeyService.listConfigs();
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({
                success: configs.success,
                configurations: configs.data.map(config => ({
                  id: config.id,
                  name: config.name,
                  slug: config.slug,
                  workspace_id: config.workspace_id,
                  status: config.status,
                  is_default: config.is_default,
                  created_at: config.created_at,
                  last_updated_at: config.last_updated_at,
                  owner_id: config.owner_id,
                  updated_by: config.updated_by
                }))
              }, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{ 
              type: "text", 
              text: `Error fetching configurations: ${error instanceof Error ? error.message : 'Unknown error'}`
            }]
          };
        }
      }
    );
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 mentions retrieving data but doesn't disclose behavioral traits like pagination, rate limits, authentication needs, or whether it's read-only. 'Retrieve' suggests a read operation, but this isn't explicitly stated. The description adds minimal behavioral context beyond the basic action.

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?

Single sentence, front-loaded with the core action ('Retrieve all configurations'), followed by specifics on what's included. Zero waste, appropriately sized for a simple list tool. Every word earns its place.

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 a simple tool with 0 parameters, the description is incomplete. It lacks details on return format (e.g., list structure, fields), behavioral constraints, or error handling. For a tool that retrieves organizational data, more context on scope and limitations would be helpful.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to add parameter details, so baseline is 4. It implicitly confirms no filtering or input is required by stating 'all configurations', aligning with the empty schema.

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 ('Retrieve') and resource ('all configurations in your Portkey organization'), specifying what data is included ('their status and workspace associations'). It distinguishes from siblings like 'get_config' (singular) and 'get_workspace' (different resource), though not explicitly. Purpose is specific but could better differentiate from other list tools.

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 like 'list_all_users' or 'list_workspaces'. The description implies it's for retrieving configurations broadly, but doesn't specify prerequisites, context, or exclusions. Usage is implied by the resource name alone.

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

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/r-huijts/portkey-admin-mcp-server'

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