{"record":{"id":"414e3eb8270bdd66","repo":"googleapis/mcp-toolbox","slug":"error-embedding-parameters-w","errorCode":null,"errorMessage":"error embedding parameters: %w","messagePattern":"error embedding parameters: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/invoke/command.go","lineNumber":133,"sourceCode":"\t}\n\n\ttoolParams, err := tool.GetParameters(src)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"error getting parameters for tool: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\tparsedParams, err := parameters.ParseParams(toolParams, params, nil)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"invalid parameters: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\tparsedParams, err = tool.EmbedParams(ctx, parsedParams, primitiveMgr)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"error embedding parameters: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\t// Client Auth not supported for ephemeral CLI call\n\trequiresAuth, err := tool.RequiresClientAuthorization(src)\n\tif err != nil {\n\t\terrMsg := fmt.Errorf(\"failed to check auth requirements: %w\", err)\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\tif requiresAuth {\n\t\terrMsg := fmt.Errorf(\"client authorization is not supported\")\n\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\treturn errMsg\n\t}\n\n\tresult, err := tool.Invoke(ctx, src, parsedParams, \"\")","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/cmd/internal/invoke/command.go#L115-L151","documentation":"Thrown by runInvoke (cmd/internal/invoke/command.go:133) when tool.EmbedParams fails while processing parameter templates such as {{authToken}}, {{.param}} references, or embedding-model-backed parameters (e.g. {{embedding(...)}}) that resolve against the PrimitiveManager. It indicates a parameter that depends on runtime context or another primitive could not be embedded.","triggerScenarios":"Invoking a tool whose parameters contain template expressions: an auth service reference ({{authToken}}) with no auth service configured for the tool, an embedding parameter referencing an embeddingModelsMap entry that is missing or misconfigured, or an invalid template syntax.","commonSituations":"Tool YAML declares `authRequired: [myAuth]` but the auth service failed to initialize; an embedding-based tool (e.g. vector search) points at an embedding model name not defined in the config; typos in template placeholders inside parameter descriptions.","solutions":["Read the wrapped error to find which parameter/template failed to embed.","Verify the auth service or embedding model referenced by the tool's config exists and initialized successfully (check server startup logs).","Fix the tools YAML so template expressions reference defined primitives with correct syntax.","Remove the templated parameter or supply the value directly if dynamic embedding is not needed."],"exampleFix":"# before (embedding model not defined)\ntools:\n  search:\n    kind: postgres-sql\n    parameters:\n      - name: q\n        type: string\n        description: '{{embedding(myEmbedder) question}}'\n# after (define the model under embeddingModels)\nembeddingModels:\n  myEmbedder:\n    provider: gemini\n    model: text-embedding-004","handlingStrategy":"validation","validationCode":"// Before invoking, confirm referenced primitives initialized:\n// 1) grep tools.yaml for template expressions: '{{'\n// 2) confirm each referenced auth service / embedding model is defined in the same config\n// 3) run toolbox serve and watch for 'failed to initialize resources'","typeGuard":null,"tryCatchPattern":"if err := runInvoke(...); err != nil {\n  if strings.Contains(err.Error(), \"error embedding parameters\") {\n    log.Fatalf(\"unresolvable template/auth/embedding reference: %v\", err)\n  }\n}","preventionTips":["Define every embedding model and auth service referenced by template expressions.","Keep template syntax exactly as documented ({{...}}) — typos silently break embedding.","Test templated tools via the MCP server first, where embedding errors surface at startup or call time with full context."],"tags":["cli","parameters","templates","embeddings"],"backgroundTag":"parameter-template-resolution-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"}