Documentation
¶
Index ¶
- Constants
- func BroadPublicRedactedPresetName() string
- func BusinessAnalysisToolNames() []string
- func ExpandToolPreset(name string) ([]string, error)
- func ExpandToolPresetFacadeRoutedTools(name string) ([]string, error)
- func ExpandToolPresetReaderGrantTools(name string) ([]string, error)
- func FacadeHiddenRoutedToolNames() []string
- func FacadeToolNames() []string
- func IsBroadPublicRedactedPreset(name string) bool
- func ParseToolAllowlist(raw string) ([]string, error)
- func PolicySwitchNames() []string
- func PolicySwitchReloadContract() string
- func PostgresRedactedAllReadonlyToolNames() []string
- func ToolCatalogNames() []string
- func ValidateGovernanceAllowlist(allowlist []string) error
- func WriteToolPresetCatalog(w io.Writer) error
- type BlocklistGuard
- type FacadeOperation
- type LimitPolicy
- func (p LimitPolicy) BusinessAnalysisLimit(value int) int
- func (p LimitPolicy) LifecycleLimit(value int) int
- func (p LimitPolicy) MissingTranscriptLimit(value int) int
- func (p LimitPolicy) Normalize() LimitPolicy
- func (p LimitPolicy) SearchLimit(value int) int
- func (p LimitPolicy) WithOverride(field string, value int) (LimitPolicy, error)
- type PolicySwitches
- type PublicRuntimeInfo
- type Request
- type RuntimeInfo
- type Server
- type ServerOption
- func WithBlocklistGuard(guard *BlocklistGuard) ServerOption
- func WithBusinessAnalysisSmallCellMin(min int) ServerOption
- func WithFacadeRoutedToolAllowlist(names []string) ServerOption
- func WithGovernanceCheck(check func(context.Context) error) ServerOption
- func WithLimitPolicy(policy LimitPolicy) ServerOption
- func WithPolicySwitches(switches PolicySwitches) ServerOption
- func WithRestrictedAccountQueryTerms(terms []string) ServerOption
- func WithRuntimeInfo(info RuntimeInfo) ServerOption
- func WithSuppressedCallIDs(callIDs []string) ServerOption
- func WithToolAllowlist(names []string) ServerOption
- func WithTranscriptEvidenceProvenance(provenance TranscriptEvidenceProvenance) ServerOption
- type Store
- type ToolInfo
- type ToolPresetInfo
- type TranscriptEvidenceProvenance
Constants ¶
const ( FacadeToolStatus = "gong_status" FacadeToolDiscoverCapabilities = "gong_discover_capabilities" FacadeToolQuery = "gong_query" FacadeToolAnalyze = "gong_analyze" FacadeToolGetEvidence = "gong_get_evidence" FacadeToolExplainLimitations = "gong_explain_limitations" )
Stable facade tool names. They must remain stable across versions even as operations are added or evolve.
const ( OpStatusSync = "status.sync" OpQueryCalls = "query.calls" OpQueryScorecards = "query.scorecards" OpQueryScorecardDetail = "query.scorecard_detail" OpQueryTranscriptSegments = "query.transcript_segments" OpAnalyzeCohortBuild = "analyze.cohort.build" OpAnalyzeCohortInspect = "analyze.cohort.inspect" OpAnalyzeThemesDiscover = "analyze.themes.discover" OpAnalyzeLimitationsExplain = "analyze.limitations.explain" OpEvidenceQuotesSearch = "evidence.quotes.search" OpEvidenceQuotePackBuild = "evidence.quote_pack.build" OpEvidenceHighlightsList = "evidence.highlights.list" OpEvidenceCallDrilldown = "evidence.call_drilldown" OpQuestionAnswer = "question.answer" OpProspectQuestionAnswer = "prospect.question.answer" OpThemeIntelReport = "theme_intelligence_report" OpExtractBuyerQuestions = "extract.buyer_questions" OpExtractObjectionSignals = "extract.objection_signals" )
Operation names are dotted, lowercase, and stable across versions.
Variables ¶
This section is empty.
Functions ¶
func BroadPublicRedactedPresetName ¶ added in v0.4.0
func BroadPublicRedactedPresetName() string
BroadPublicRedactedPresetName returns the canonical name of the broad-public-redacted preset. It shares the underlying tool list with redacted-all-readonly, but the name signals a customer-test posture rather than an internal lab posture.
func BusinessAnalysisToolNames ¶ added in v0.3.2
func BusinessAnalysisToolNames() []string
func ExpandToolPreset ¶ added in v0.3.2
func ExpandToolPresetFacadeRoutedTools ¶ added in v0.4.0
func ExpandToolPresetReaderGrantTools ¶ added in v0.4.0
func FacadeHiddenRoutedToolNames ¶ added in v0.4.1
func FacadeHiddenRoutedToolNames() []string
func FacadeToolNames ¶ added in v0.4.0
func FacadeToolNames() []string
func IsBroadPublicRedactedPreset ¶ added in v0.4.0
IsBroadPublicRedactedPreset reports whether name resolves to the broad-public-redacted profile. It intentionally distinguishes this customer-test posture from redacted-all-readonly even though they share the same reviewed tool surface.
func ParseToolAllowlist ¶ added in v0.3.2
func PolicySwitchNames ¶ added in v0.4.0
func PolicySwitchNames() []string
PolicySwitchNames returns the canonical machine-readable list of policy switch names recognized by ParsePolicySwitches.
func PolicySwitchReloadContract ¶ added in v0.4.0
func PolicySwitchReloadContract() string
PolicySwitchReloadContract returns the documented reload semantics for policy switches. Tooling should treat any change to this string as a breaking contract change.
func PostgresRedactedAllReadonlyToolNames ¶ added in v0.4.0
func PostgresRedactedAllReadonlyToolNames() []string
func ToolCatalogNames ¶ added in v0.3.2
func ToolCatalogNames() []string
func ValidateGovernanceAllowlist ¶ added in v0.3.2
func WriteToolPresetCatalog ¶ added in v0.3.2
Types ¶
type BlocklistGuard ¶ added in v0.4.0
type BlocklistGuard = governance.BlocklistGuard
BlocklistGuard is re-exported from the governance package so MCP server-option callers do not need to import internal/governance directly.
type FacadeOperation ¶ added in v0.4.0
type FacadeOperation struct {
Name string `json:"operation"`
Version string `json:"version"`
Description string `json:"description"`
FacadeTool string `json:"facade_tool"`
RoutedTool string `json:"routed_tool"`
RoutedFallback string `json:"routed_tool_fallback,omitempty"`
ExposureLevel string `json:"exposure_level"`
AllowedPresets []string `json:"allowed_presets"`
InputSchema map[string]any `json:"input_schema"`
Examples []any `json:"examples,omitempty"`
}
FacadeOperation describes one logical MCP operation routed by the stable facade tools (Phase 13e2). Each operation pins a small, reviewable contract: a name, a human-readable description, the facade tool that surfaces it, the existing internal tool the facade dispatches to, an exposure level, and the presets in which the routed tool is currently exposed by default.
The facade is additive: top-level individual tools (search_calls, get_sync_status, build_call_cohort, etc.) remain available for operator and analyst testing. The facade lets MCP clients depend on a smaller, more stable surface while operations grow underneath.
func FacadeOperationByName ¶ added in v0.4.0
func FacadeOperationByName(name string) (FacadeOperation, bool)
FacadeOperationByName returns the operation registered under the given dotted name, if any.
func FacadeOperations ¶ added in v0.4.0
func FacadeOperations() []FacadeOperation
FacadeOperations returns the registry of all known facade operations. The list is sorted by operation name for stable output.
type LimitPolicy ¶ added in v0.3.3
type LimitPolicy struct {
SearchResults int `json:"search_results"`
CRMFields int `json:"crm_fields"`
LateStageSignals int `json:"late_stage_signals"`
MissingTranscripts int `json:"missing_transcripts"`
OpportunitySummaries int `json:"opportunity_summaries"`
CRMMatrixCells int `json:"crm_matrix_cells"`
LifecycleResults int `json:"lifecycle_results"`
LifecycleCRMFields int `json:"lifecycle_crm_fields"`
CallFactGroups int `json:"call_fact_groups"`
InventoryResults int `json:"inventory_results"`
BusinessAnalysisRows int `json:"business_analysis_rows"`
}
func DefaultLimitPolicy ¶ added in v0.3.3
func DefaultLimitPolicy() LimitPolicy
func LimitPolicyFromEnv ¶ added in v0.3.3
func LimitPolicyFromEnv(getenv func(string) string) (LimitPolicy, error)
func (LimitPolicy) BusinessAnalysisLimit ¶ added in v0.3.3
func (p LimitPolicy) BusinessAnalysisLimit(value int) int
func (LimitPolicy) LifecycleLimit ¶ added in v0.3.3
func (p LimitPolicy) LifecycleLimit(value int) int
func (LimitPolicy) MissingTranscriptLimit ¶ added in v0.3.3
func (p LimitPolicy) MissingTranscriptLimit(value int) int
func (LimitPolicy) Normalize ¶ added in v0.3.3
func (p LimitPolicy) Normalize() LimitPolicy
func (LimitPolicy) SearchLimit ¶ added in v0.3.3
func (p LimitPolicy) SearchLimit(value int) int
func (LimitPolicy) WithOverride ¶ added in v0.3.3
func (p LimitPolicy) WithOverride(field string, value int) (LimitPolicy, error)
type PolicySwitches ¶ added in v0.4.0
type PolicySwitches struct {
HideAccountNames bool `json:"hide_account_names"`
HideCallTitles bool `json:"hide_call_titles"`
HideRawCallIDs bool `json:"hide_raw_call_ids"`
HideSpeakerIDs bool `json:"hide_speaker_ids"`
HideContactNames bool `json:"hide_contact_names"`
HideContactEmails bool `json:"hide_contact_emails"`
HideOpportunityNames bool `json:"hide_opportunity_names"`
HideLossReasons bool `json:"hide_loss_reasons"`
HideCRMValueSnippets bool `json:"hide_crm_value_snippets"`
}
PolicySwitches is the customer-deployment policy switch contract for the broad-public-redacted profile and stricter customer profiles. Each switch suppresses one class of customer-identifying field at MCP emit time.
Reload contract: switches take effect at MCP startup. They are not hot-reloaded by gongmcp; operators must restart the MCP process to apply a changed policy. This is documented and tested via PolicySwitchReloadContract.
func BroadPublicRedactedDefaultPolicySwitches ¶ added in v0.4.0
func BroadPublicRedactedDefaultPolicySwitches() PolicySwitches
BroadPublicRedactedDefaultPolicySwitches returns the broad-public-redacted profile's default policy posture. Raw call IDs are off by default; stable refs are preferred for client-visible output.
func MergePolicySwitches ¶ added in v0.4.0
func MergePolicySwitches(a, b PolicySwitches) PolicySwitches
MergePolicySwitches combines two PolicySwitches values; any flag enabled in either input is enabled in the output. Used to layer profile defaults on top of operator-provided switches.
func ParsePolicySwitches ¶ added in v0.4.0
func ParsePolicySwitches(raw string) (PolicySwitches, error)
ParsePolicySwitches parses a comma-separated switch list (e.g. "hide_account_names,hide_call_titles") into a PolicySwitches value. Empty input yields the zero value with every switch disabled.
func (PolicySwitches) Any ¶ added in v0.4.0
func (p PolicySwitches) Any() bool
Any reports whether at least one switch is enabled.
func (PolicySwitches) EnabledNames ¶ added in v0.4.0
func (p PolicySwitches) EnabledNames() []string
EnabledNames returns the canonical names of enabled switches in stable order.
func (PolicySwitches) IsEnabled ¶ added in v0.4.0
func (p PolicySwitches) IsEnabled(name string) bool
IsEnabled reports whether the named switch is enabled.
type PublicRuntimeInfo ¶ added in v0.4.0
type PublicRuntimeInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Commit string `json:"commit,omitempty"`
BuildDate string `json:"build_date,omitempty"`
ToolPreset string `json:"tool_preset,omitempty"`
DeploymentID string `json:"deployment_id,omitempty"`
StartedAtUTC string `json:"started_at_utc,omitempty"`
ToolCount int `json:"tool_count"`
FacadeRoutedToolCount int `json:"facade_routed_tool_count"`
TranscriptEvidenceProvenance string `json:"transcript_evidence_provenance"`
PolicySwitches PolicySwitches `json:"policy_switches"`
PolicySwitchesEnabled []string `json:"policy_switches_enabled,omitempty"`
PolicySwitchReloadContract string `json:"policy_switch_reload_contract"`
}
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type RuntimeInfo ¶ added in v0.4.0
type RuntimeInfo struct {
Commit string
BuildDate string
ToolPreset string
DeploymentID string
StartedAtUTC string
}
RuntimeInfo captures non-secret runtime metadata that helps MCP clients and manual testers prove which server instance they are connected to.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServerWithOptions ¶
func NewServerWithOptions(store Store, name, version string, opts ...ServerOption) *Server
func (*Server) RuntimeInfo ¶ added in v0.4.0
func (s *Server) RuntimeInfo() PublicRuntimeInfo
type ServerOption ¶
type ServerOption func(*Server)
func WithBlocklistGuard ¶ added in v0.4.0
func WithBlocklistGuard(guard *BlocklistGuard) ServerOption
WithBlocklistGuard installs an emit-time defense-in-depth filter that suppresses MCP tool output rows/fields whenever a blocklisted entity is detected. The guard sits in front of MCP serialization on the highest-risk paths (search_calls, get_call) and is intended to catch missed joins or new columns that bypass the source-to-serving redaction.
func WithBusinessAnalysisSmallCellMin ¶ added in v0.3.4
func WithBusinessAnalysisSmallCellMin(min int) ServerOption
func WithFacadeRoutedToolAllowlist ¶ added in v0.4.0
func WithFacadeRoutedToolAllowlist(names []string) ServerOption
func WithGovernanceCheck ¶ added in v0.3.0
func WithGovernanceCheck(check func(context.Context) error) ServerOption
func WithLimitPolicy ¶ added in v0.3.3
func WithLimitPolicy(policy LimitPolicy) ServerOption
func WithPolicySwitches ¶ added in v0.4.0
func WithPolicySwitches(switches PolicySwitches) ServerOption
WithPolicySwitches installs the customer-deployment policy switch contract for this MCP process. Switches take effect at startup and require a restart to change; see PolicySwitchReloadContract.
func WithRestrictedAccountQueryTerms ¶ added in v0.4.0
func WithRestrictedAccountQueryTerms(terms []string) ServerOption
func WithRuntimeInfo ¶ added in v0.4.0
func WithRuntimeInfo(info RuntimeInfo) ServerOption
func WithSuppressedCallIDs ¶ added in v0.3.0
func WithSuppressedCallIDs(callIDs []string) ServerOption
func WithToolAllowlist ¶
func WithToolAllowlist(names []string) ServerOption
func WithTranscriptEvidenceProvenance ¶ added in v0.3.3
func WithTranscriptEvidenceProvenance(provenance TranscriptEvidenceProvenance) ServerOption
type Store ¶
type Store interface {
SyncStatusSummary(ctx context.Context) (*sqlite.SyncStatusSummary, error)
SearchCallsRaw(ctx context.Context, params sqlite.CallSearchParams) ([]json.RawMessage, error)
GetCallDetail(ctx context.Context, callID string) (*sqlite.CallDetail, error)
ResolveCallIDByRef(ctx context.Context, ref string) (string, error)
ListCRMObjectTypes(ctx context.Context) ([]sqlite.CRMObjectTypeSummary, error)
ListCRMFields(ctx context.Context, objectType string, limit int) ([]sqlite.CRMFieldSummary, error)
SearchCRMFieldValues(ctx context.Context, params sqlite.CRMFieldValueSearchParams) ([]sqlite.CRMFieldValueMatch, error)
ListCRMIntegrations(ctx context.Context) ([]sqlite.CRMIntegrationRecord, error)
ListCRMSchemaObjects(ctx context.Context, integrationID string) ([]sqlite.CRMSchemaObjectRecord, error)
ListCRMSchemaFields(ctx context.Context, params sqlite.CRMSchemaFieldListParams) ([]sqlite.CRMSchemaFieldRecord, error)
ListGongSettings(ctx context.Context, params sqlite.GongSettingListParams) ([]sqlite.GongSettingRecord, error)
ListScorecards(ctx context.Context, params sqlite.ScorecardListParams) ([]sqlite.ScorecardSummary, error)
GetScorecardDetail(ctx context.Context, scorecardID string) (*sqlite.ScorecardDetail, error)
ScorecardActivityOverview(ctx context.Context, limit int) (*sqlite.ScorecardActivityOverview, error)
ActiveBusinessProfile(ctx context.Context) (*sqlite.BusinessProfile, error)
ListBusinessConcepts(ctx context.Context) ([]sqlite.BusinessConcept, error)
ListUnmappedCRMFields(ctx context.Context, params sqlite.UnmappedCRMFieldParams) ([]sqlite.UnmappedCRMField, error)
AnalyzeLateStageSignals(ctx context.Context, params sqlite.LateStageSignalParams) (*sqlite.LateStageSignalsReport, error)
ListOpportunitiesMissingTranscripts(ctx context.Context, params sqlite.OpportunityMissingTranscriptParams) ([]sqlite.OpportunityMissingTranscriptSummary, error)
SearchTranscriptSegmentsByCRMContext(ctx context.Context, params sqlite.TranscriptCRMSearchParams) ([]sqlite.TranscriptCRMSearchResult, error)
SummarizeOpportunityCalls(ctx context.Context, params sqlite.OpportunityCallSummaryParams) ([]sqlite.OpportunityCallSummary, error)
CRMFieldPopulationMatrix(ctx context.Context, params sqlite.CRMFieldPopulationMatrixParams) (*sqlite.CRMFieldPopulationMatrix, error)
ListLifecycleBucketDefinitions(ctx context.Context) ([]sqlite.LifecycleBucketDefinition, error)
ListLifecycleBucketDefinitionsWithSource(ctx context.Context, requested string) ([]sqlite.LifecycleBucketDefinition, *sqlite.ProfileQueryInfo, error)
SummarizeCallsByLifecycle(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, error)
SummarizeCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleSummaryParams) ([]sqlite.LifecycleBucketSummary, *sqlite.ProfileQueryInfo, error)
SearchCallsByLifecycle(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, error)
SearchCallsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleCallSearchParams) ([]sqlite.LifecycleCallSearchResult, *sqlite.ProfileQueryInfo, error)
PrioritizeTranscriptsByLifecycle(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, error)
PrioritizeTranscriptsByLifecycleWithSource(ctx context.Context, params sqlite.LifecycleTranscriptPriorityParams) ([]sqlite.LifecycleTranscriptPriority, *sqlite.ProfileQueryInfo, error)
CompareLifecycleCRMFields(ctx context.Context, params sqlite.LifecycleCRMFieldComparisonParams) (*sqlite.LifecycleCRMFieldComparison, error)
SummarizeCallFacts(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, error)
SummarizeCallFactsWithSource(ctx context.Context, params sqlite.CallFactsSummaryParams) ([]sqlite.CallFactsSummaryRow, *sqlite.ProfileQueryInfo, error)
CallFactsCoverage(ctx context.Context) (*sqlite.CallFactsCoverage, error)
SearchTranscriptSegments(ctx context.Context, query string, limit int) ([]sqlite.TranscriptSearchResult, error)
SearchTranscriptSegmentsByCallFacts(ctx context.Context, params sqlite.TranscriptCallFactsSearchParams) ([]sqlite.TranscriptCallFactsSearchResult, error)
SearchTranscriptQuotesWithAttribution(ctx context.Context, params sqlite.TranscriptAttributionSearchParams) ([]sqlite.TranscriptAttributionSearchResult, error)
SearchBusinessAnalysisCalls(ctx context.Context, params sqlite.BusinessAnalysisCallSearchParams) (*sqlite.BusinessAnalysisCallSearchResult, error)
SearchBusinessAnalysisEvidence(ctx context.Context, params sqlite.BusinessAnalysisEvidenceSearchParams) ([]sqlite.BusinessAnalysisEvidenceRow, error)
SummarizeBusinessAnalysisDimension(ctx context.Context, params sqlite.BusinessAnalysisDimensionSummaryParams) ([]sqlite.BusinessAnalysisDimensionRow, error)
FindCallsMissingTranscripts(ctx context.Context, limit int) ([]sqlite.MissingTranscriptCall, error)
FindCallsMissingTranscriptsByFilters(ctx context.Context, params sqlite.MissingTranscriptSearchParams) ([]sqlite.MissingTranscriptCall, error)
ListAIHighlights(ctx context.Context, params sqlite.AIHighlightListParams) ([]sqlite.AIHighlightRow, error)
CallDrilldownEvidence(ctx context.Context, params sqlite.CallDrilldownEvidenceParams) ([]sqlite.CallDrilldownEvidenceRow, error)
}
type ToolInfo ¶
type ToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]any `json:"input_schema"`
}
func FindToolWithLimitPolicy ¶ added in v0.3.3
func FindToolWithLimitPolicy(name string, policy LimitPolicy) (ToolInfo, bool)
func ToolCatalog ¶
func ToolCatalog() []ToolInfo
func ToolCatalogWithLimitPolicy ¶ added in v0.3.3
func ToolCatalogWithLimitPolicy(policy LimitPolicy) []ToolInfo
type ToolPresetInfo ¶ added in v0.3.2
type ToolPresetInfo struct {
Name string `json:"name"`
Aliases []string `json:"aliases,omitempty"`
Purpose string `json:"purpose"`
Tools []string `json:"tools"`
ToolCount int `json:"tool_count"`
Recommended string `json:"recommended_for"`
}
func ToolPresetCatalog ¶ added in v0.3.2
func ToolPresetCatalog() []ToolPresetInfo
type TranscriptEvidenceProvenance ¶ added in v0.3.3
type TranscriptEvidenceProvenance string
const ( TranscriptEvidenceRedacted TranscriptEvidenceProvenance = "redacted" TranscriptEvidenceAlias TranscriptEvidenceProvenance = "alias" TranscriptEvidenceRaw TranscriptEvidenceProvenance = "raw" )
func ParseTranscriptEvidenceProvenance ¶ added in v0.3.3
func ParseTranscriptEvidenceProvenance(value string) (TranscriptEvidenceProvenance, error)