Skip to main content
Glama
chrbailey

promptspeak-mcp-server

ps_confidence_bulk_set

Set multiple confidence thresholds simultaneously to control AI agent risk levels before execution, enabling batch configuration for governance policies.

Instructions

Set multiple confidence thresholds at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdsYes

Implementation Reference

  • Main handler implementation for ps_confidence_bulk_set. Takes a ConfidenceBulkSetRequest with thresholds, validates each threshold value (0-1 range), updates valid thresholds via operatorConfig.setThreshold(), and returns success status with lists of updated and failed keys.
    export function ps_confidence_bulk_set(request: ConfidenceBulkSetRequest): ConfidenceBulkSetResult {
      const updated: string[] = [];
      const failed: string[] = [];
    
      for (const [key, value] of Object.entries(request.thresholds)) {
        if (value === undefined) continue;
    
        if (value < 0 || value > 1) {
          failed.push(`${key}: value out of range`);
          continue;
        }
    
        operatorConfig.setThreshold(key as keyof ConfidenceThresholds, value);
        updated.push(key);
      }
    
      return {
        success: failed.length === 0,
        updated,
        failed,
        message: failed.length === 0
          ? `Updated ${updated.length} thresholds`
          : `Updated ${updated.length}, failed ${failed.length}`
      };
    }
  • Type definitions for ps_confidence_bulk_set: ConfidenceBulkSetRequest interface with thresholds (Partial<ConfidenceThresholds>) and ConfidenceBulkSetResult interface with success, updated, failed, and message fields.
    export interface ConfidenceBulkSetRequest {
      thresholds: Partial<ConfidenceThresholds>;
    }
    
    export interface ConfidenceBulkSetResult {
      success: boolean;
      updated: string[];
      failed: string[];
      message: string;
    }
  • MCP tool registration with schema definition. Defines 'ps_confidence_bulk_set' tool with description and JSON schema specifying required 'thresholds' property of type object.
    {
      name: 'ps_confidence_bulk_set',
      description: 'Set multiple confidence thresholds at once.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          thresholds: { type: 'object' }
        },
        required: ['thresholds']
      }
    }
  • Handler registration mapping tool name to handler function. Registers ps_confidence_bulk_set with its handler, category 'confidence', and description.
    ps_confidence_bulk_set: {
      handler: (args) => ps_confidence_bulk_set(args as any),
      category: 'confidence',
      description: 'Bulk set confidence levels',
    },
  • Re-exports ps_confidence_bulk_set from src/operator/index.js, making it available for import by the tool registry and other modules.
    export {
      ps_config_set,
      ps_config_activate,
      ps_config_get,
      ps_config_export,
      ps_config_import,
      ps_confidence_set,
      ps_confidence_get,
      ps_confidence_bulk_set,
      ps_feature_set,
      ps_feature_get,
      ps_audit_get
    } from '../operator/index.js';

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/chrbailey/promptspeak-mcp-server'

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