{"record":{"id":"baca461089b2b1e1","repo":"microsoft/semantic-kernel","slug":"missing-or-malformed-vector-store-ids-in-spec","errorCode":null,"errorMessage":"Missing or malformed 'vector_store_ids' in: {spec}","messagePattern":"Missing or malformed 'vector_store_ids' in: (.+?)","errorType":"validation","errorClass":"AgentInitializationException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/azure_ai/azure_ai_agent.py","lineNumber":171,"sourceCode":"    count = opts.get(\"count\", 5)\n    if not isinstance(count, int):\n        raise AgentInitializationException(f\"'count' must be an integer in: {spec}\")\n    freshness = opts.get(\"freshness\", \"\")\n\n    return BingGroundingTool(connection_id=conn_id, market=market, set_lang=set_lang, count=count, freshness=freshness)\n\n\n@_register_tool(\"code_interpreter\")\ndef _code_interpreter(spec: ToolSpec) -> CodeInterpreterTool:\n    file_ids = spec.options.get(\"file_ids\")\n    return CodeInterpreterTool(file_ids=file_ids) if file_ids else CodeInterpreterTool()\n\n\n@_register_tool(\"file_search\")\ndef _file_search(spec: ToolSpec) -> FileSearchTool:\n    vector_store_ids = spec.options.get(\"vector_store_ids\")\n    if not vector_store_ids or not isinstance(vector_store_ids, list) or not vector_store_ids[0]:\n        raise AgentInitializationException(f\"Missing or malformed 'vector_store_ids' in: {spec}\")\n    return FileSearchTool(vector_store_ids=vector_store_ids)\n\n\n@_register_tool(\"function\")\ndef _function(spec: ToolSpec, kernel: \"Kernel\") -> ToolDefinition:\n    def parse_fqn(fqn: str) -> tuple[str, str]:\n        parts = fqn.split(\".\")\n        if len(parts) != 2:\n            raise AgentInitializationException(f\"Function `{fqn}` must be in the form `pluginName.functionName`.\")\n        return parts[0], parts[1]\n\n    if not spec.id:\n        raise AgentInitializationException(\"Function ID is required for function tools.\")\n    plugin_name, function_name = parse_fqn(spec.id)\n    funcs = kernel.get_list_of_function_metadata_filters({\"included_functions\": f\"{plugin_name}-{function_name}\"})\n\n    match len(funcs):\n        case 0:","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/azure_ai/azure_ai_agent.py#L153-L189","documentation":"Raised when building a file_search tool and spec.options.vector_store_ids is absent, not a list, or has a falsy first element. The tool requires at least one pre-provisioned Azure vector store ID.","triggerScenarios":"Declarative spec omits vector_store_ids, provides it as a scalar instead of a list, or passes an empty list for a file_search tool.","commonSituations":"Developer references a file or blob instead of a vector store ID; forgets to create the vector store first; copies a template placeholder.","solutions":["Create the vector store in Azure AI (via portal or SDK) and add its ID to vector_store_ids as a list.","Ensure the value is a list with a non-empty first element.","If files must be indexed, upload and create a vector store referencing them, then pass the store ID."],"exampleFix":"// before\ntools:\n  - type: file_search\n    options:\n      file_ids: [\"file-abc\"]\n\n// after\ntools:\n  - type: file_search\n    options:\n      vector_store_ids:\n        - \"vstore-123\"","handlingStrategy":"validation","validationCode":"def validate_vector_store_ids(opts: dict) -> None:\n    v = opts.get(\"vector_store_ids\")\n    if not isinstance(v, list) or not v or not v[0]:\n        raise ValueError(\"file_search requires non-empty list 'vector_store_ids'\")","typeGuard":"def has_vector_store_ids(opts: dict) -> bool:\n    v = opts.get(\"vector_store_ids\")\n    return isinstance(v, list) and bool(v) and bool(v[0])","tryCatchPattern":null,"preventionTips":["Provision the Azure vector store first and capture its ID before authoring the spec.","Differentiate vector_store_ids from file_ids; only the former is valid for file_search."],"tags":["azure-ai-agent","declarative-spec","file-search","configuration"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}