{"record":{"id":"f5c6d9a32890a245","repo":"googleapis/mcp-toolbox","slug":"error-generating-manifest-for-tool-q-w-f5c6d9","errorCode":null,"errorMessage":"error generating manifest for tool %q: %w","messagePattern":"error generating manifest for tool %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/toolsets.go","lineNumber":77,"sourceCode":"}\n\n// BuildManifest resolves the manifest for every tool in the toolset against the\n// provided sources, returning an error if any tool's manifest cannot be built.\nfunc (t Toolset) BuildManifest(pMgr PrimitiveManagerI) (ToolsetManifest, error) {\n\ttoolsManifest := make(map[string]Manifest, len(t.Tools))\n\tfor _, tool := range t.Tools {\n\t\tsrcName := (*tool).GetSourceName()\n\t\tvar src sources.Source\n\t\tvar ok bool\n\t\tif srcName != \"\" {\n\t\t\tsrc, ok = pMgr.GetSource(srcName)\n\t\t\tif !ok {\n\t\t\t\treturn ToolsetManifest{}, fmt.Errorf(\"unable to retrieve %s source for tool %q\", srcName, (*tool).GetName())\n\t\t\t}\n\t\t}\n\t\tm, err := (*tool).Manifest(src)\n\t\tif err != nil {\n\t\t\treturn ToolsetManifest{}, fmt.Errorf(\"error generating manifest for tool %q: %w\", (*tool).GetName(), err)\n\t\t}\n\t\ttoolsManifest[(*tool).GetName()] = m\n\t}\n\treturn ToolsetManifest{ServerVersion: t.Manifest.ServerVersion, ToolsManifest: toolsManifest}, nil\n}\n\nfunc (t ToolsetConfig) Initialize(serverVersion string, toolsMap map[string]Tool) (Toolset, error) {\n\t// finish toolset setup\n\t// Check each declared tool name exists\n\ttoolset := Toolset{\n\t\tToolsetConfig: t,\n\t\tTools:         make([]*Tool, 0, len(t.ToolNames)),\n\t\tManifest: ToolsetManifest{\n\t\t\tServerVersion: serverVersion,\n\t\t},\n\t\ttoolNameSet: make(map[string]struct{}, len(t.ToolNames)),\n\t}\n\tif !IsValidName(toolset.Name) {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/toolsets.go#L59-L95","documentation":"After resolving the source, BuildManifest calls the tool's Manifest(src) method to produce its manifest entry. If that call returns an error, it is wrapped with this message naming the tool. The tool itself refused to build its manifest, usually because the provided source is not compatible with the tool.","triggerScenarios":"Calling BuildManifest where (*tool).Manifest(src) fails — most commonly ValidateSource-style incompatibility (tool's kind paired with a wrong-kind source that slipped past config), or a tool-specific error building parameter manifests.","commonSituations":"A tool configured against a source of the wrong engine type; a tool whose parameter/template definitions are invalid so the manifest cannot be computed; custom tool implementations returning errors from Manifest.","solutions":["Check the wrapped cause for the tool's underlying Manifest failure","Verify the tool's `source:` points to a source of the correct kind (e.g. a Trino tool on a Trino source)","Fix invalid parameter or template parameter definitions in the tool config","Update or fix a custom tool's Manifest implementation if using custom tools"],"exampleFix":"// before (tools.yaml)\nrun_query:\n  kind: trino-execute-sql\n  source: my-postgres\n// after\nrun_query:\n  kind: trino-execute-sql\n  source: my-trino","handlingStrategy":"validation","validationCode":"// Pre-check tool/source kind pairing before building manifests\nif tool.Kind == \"trino-execute-sql\" && sourceKindOf[tool.Source] != \"trino\" {\n    return fmt.Errorf(\"tool %q requires a trino source, got %q\", tool.Name, sourceKindOf[tool.Source])\n}","typeGuard":null,"tryCatchPattern":"m, err := toolset.Build(pMgr)\nif err != nil {\n    if strings.Contains(err.Error(), \"error generating manifest\") {\n        log.Printf(\"fix tool/source pairing or parameters: %v\", err)\n    }\n    return err\n}","preventionTips":["Pair each tool kind with its matching engine source","Validate parameter definitions before deployment","Run the server once locally against the config as a smoke test"],"tags":["go","toolset","manifest"],"backgroundTag":"manifest-generation-failed","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}