{"record":{"id":"b6c5c9000121e89e","repo":"microsoft/semantic-kernel","slug":"the-option-keys-store-name-and-data-sources-ar","errorCode":null,"errorMessage":"The option keys 'store_name' and 'data_sources' are required for a vector store configuration.","messagePattern":"The option keys 'store_name' and 'data_sources' are required for a vector store configuration\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs","lineNumber":164,"sourceCode":"    internal static IList<VectorStoreConfigurations>? GetVectorStoreConfigurations(this AgentToolDefinition agentToolDefinition)\n    {\n        var dataSources = agentToolDefinition.GetOption<List<object>?>(\"configurations\");\n        return dataSources is not null ? CreateVectorStoreConfigurations(dataSources) : null;\n    }\n\n    internal static List<VectorStoreConfigurations> CreateVectorStoreConfigurations(List<object> values)\n    {\n        List<VectorStoreConfigurations> configurations = [];\n        foreach (var value in values)\n        {\n            if (value is Dictionary<object, object> configurationDict)\n            {\n                var storeName = configurationDict.TryGetValue(\"store_name\", out var storeNameValue) && storeNameValue is string storeNameString ? storeNameString : null;\n                var dataSources = configurationDict.TryGetValue(\"data_sources\", out var dataSourceValue) && dataSourceValue is List<object> dataSourceList ? CreateDataSources(dataSourceList) : null;\n\n                if (string.IsNullOrEmpty(storeName) || dataSources is null)\n                {\n                    throw new ArgumentException(\"The option keys 'store_name' and 'data_sources' are required for a vector store configuration.\");\n                }\n\n                configurations.Add(new VectorStoreConfigurations(storeName, new VectorStoreConfiguration(dataSources)));\n            }\n        }\n\n        return configurations;\n    }\n\n    private static AzureFunctionBinding GetAzureFunctionBinding(this AgentToolDefinition agentToolDefinition, string bindingType)\n    {\n        Verify.NotNull(agentToolDefinition.Options);\n\n        var binding = agentToolDefinition.GetRequiredOption<Dictionary<object, object>>(bindingType);\n        if (!binding.TryGetValue(\"storage_service_endpoint\", out var endpointValue) || endpointValue is not string storageServiceEndpoint)\n        {\n            throw new ArgumentException($\"The option key '{bindingType}.storage_service_endpoint' is required.\");\n        }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs#L146-L182","documentation":"Thrown while building vector store configurations (CreateVectorStoreConfigurations). Each configuration dictionary must have a non-empty 'store_name' string and a non-null 'data_sources' list. Note store_name uses IsNullOrEmpty (so empty string fails) while data_sources only checks for null (an empty list passes).","triggerScenarios":"A vector store configuration entry omits store_name, sets it to empty, or omits the data_sources list / provides it as a non-List<object> value.","commonSituations":"Malformed configuration block; data_sources key misspelled as 'datasources'; store_name left blank.","solutions":["Provide a non-empty 'store_name' string.","Provide a 'data_sources' list (can be empty, but the key must exist and be a list)."],"exampleFix":"// before\nconfigurations:\n  - store_name: ''\n    data_sources: []\n    # empty store_name -> throws 164\n\n// after\nconfigurations:\n  - store_name: 'my-store'\n    data_sources: []","handlingStrategy":"validation","validationCode":"foreach (var v in values)\n{\n    if (v is not Dictionary<object, object> d) continue;\n    string? store = d.TryGetValue(\"store_name\", out var s) && s is string ss ? ss : null;\n    bool hasData = d.TryGetValue(\"data_sources\", out var ds) && ds is List<object>;\n    if (string.IsNullOrEmpty(store) || !hasData)\n        throw new ArgumentException(\"Each vector store configuration needs store_name and data_sources.\");\n}","typeGuard":"static bool IsValidVectorStoreConfig(Dictionary<object, object> d) =>\n    d.TryGetValue(\"store_name\", out var s) && s is string ss && !string.IsNullOrEmpty(ss)\n    && d.TryGetValue(\"data_sources\", out var ds) && ds is List<object>;","tryCatchPattern":null,"preventionTips":["Always include a non-empty store_name and a data_sources list (even if empty).","Schema-validate vector store configuration blocks."],"tags":["validation","vector-store","agent-tool","configuration"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}