Tools¶
The holodeck.tools package provides tool implementations that extend agent capabilities with semantic search, hierarchical document retrieval, and MCP server integration.
Module Overview¶
| Module | Description |
|---|---|
holodeck.tools |
Package exports for tools, mixins, and utilities |
holodeck.tools.base_tool |
Mixin classes for embedding and database configuration |
holodeck.tools.common |
Shared constants and pure utility functions |
holodeck.tools.vectorstore_tool |
Semantic search over unstructured and structured data |
holodeck.tools.hierarchical_document_tool |
Structure-aware document retrieval with hybrid search |
holodeck.tools.mcp |
MCP server integration (factory, utilities, errors) |
holodeck.tools.base_tool¶
Mixin classes that encapsulate common functionality shared between VectorStoreTool and HierarchicalDocumentTool. Mixins are used instead of inheritance because the tools have fundamentally different record types and core behaviors.
EmbeddingServiceMixin¶
EmbeddingServiceMixin
¶
Mixin for embedding service injection.
Provides the set_embedding_service method used by AgentFactory to inject a Semantic Kernel TextEmbedding service for generating real embeddings.
Required instance attributes (set by subclass init): _embedding_service: Any - stores the injected service config: Any - tool configuration with a .name attribute
set_embedding_service(service)
¶
Set the embedding service for generating embeddings.
This method allows AgentFactory to inject a Semantic Kernel TextEmbedding service for generating real embeddings instead of placeholder zeros.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
Any
|
Semantic Kernel TextEmbedding service instance (OpenAITextEmbedding or AzureTextEmbedding). |
required |
Source code in src/holodeck/tools/base_tool.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
DatabaseConfigMixin¶
DatabaseConfigMixin
¶
Mixin for database configuration resolution and collection creation.
Provides methods for resolving database configuration from various formats (None, string reference, DatabaseConfig object) and creating vector store collections with automatic fallback to in-memory storage.
Required instance attributes (set by subclass init): config: Any - tool configuration with .name and .database attributes _provider: str - stores the resolved provider name _collection: Any - stores the created collection instance _embedding_dimensions: int | None - embedding dimensions
_resolve_database_config(database)
¶
Resolve database configuration to provider and connection kwargs.
Handles three types of database configuration: 1. None - use in-memory storage 2. String reference - unresolved reference, warn and use in-memory 3. DatabaseConfig object - extract provider and connection parameters
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
database
|
DatabaseConfig | str | None
|
Database configuration (from tool config) |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, dict[str, Any]]
|
Tuple of (provider_name, connection_kwargs) |
Example
provider, kwargs = self._resolve_database_config(None) provider 'in-memory' kwargs {}
Source code in src/holodeck/tools/base_tool.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
_create_collection_with_fallback(provider, dimensions, connection_kwargs, record_class=None, definition=None)
¶
Create a vector store collection with fallback to in-memory.
Attempts to create a collection with the specified provider. If creation fails (e.g., database unreachable), falls back to in-memory storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
str
|
Vector store provider name |
required |
dimensions
|
int
|
Embedding dimensions for the collection |
required |
connection_kwargs
|
dict[str, Any]
|
Provider-specific connection parameters |
required |
record_class
|
type[Any] | None
|
Optional custom record class for the collection |
None
|
definition
|
Any | None
|
Optional VectorStoreCollectionDefinition for structured data |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Created collection instance |
Raises:
| Type | Description |
|---|---|
Exception
|
If in-memory provider also fails (shouldn't happen) |
Source code in src/holodeck/tools/base_tool.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
holodeck.tools.common¶
Shared constants and pure utility functions used by VectorStoreTool, HierarchicalDocumentTool, and other tool implementations. Follows the DRY principle for file handling, path resolution, and embedding generation.
Constants¶
SUPPORTED_EXTENSIONS¶
SUPPORTED_EXTENSIONS = frozenset({'.txt', '.md', '.pdf', '.csv', '.json'})
module-attribute
¶
FILE_TYPE_MAPPING¶
FILE_TYPE_MAPPING = {'.txt': 'text', '.md': 'text', '.pdf': 'pdf', '.csv': 'csv', '.json': 'text'}
module-attribute
¶
Functions¶
get_file_type¶
get_file_type(path)
¶
Get FileInput type from file extension.
Maps file extensions to the appropriate type value for FileProcessor. Defaults to "text" for unknown extensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
File path (string or Path object) |
required |
Returns:
| Type | Description |
|---|---|
str
|
FileInput type string ("text", "pdf", "csv", etc.) |
Example
get_file_type("document.pdf") 'pdf' get_file_type(Path("data/file.csv")) 'csv' get_file_type("unknown.xyz") 'text'
Source code in src/holodeck/tools/common.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
resolve_source_path¶
resolve_source_path(source, base_dir=None)
¶
Resolve a source path relative to a base directory.
This function handles path resolution in priority order: 1. If source is absolute, return as-is 2. If base_dir is provided, resolve relative to base_dir 3. Try agent_base_dir context variable 4. Fall back to current working directory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Source path to resolve (from tool config) |
required |
base_dir
|
str | None
|
Optional base directory for relative path resolution |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Resolved absolute Path to the source |
Example
resolve_source_path("/absolute/path/file.txt") PosixPath('/absolute/path/file.txt') resolve_source_path("relative/file.txt", "/base") PosixPath('/base/relative/file.txt')
Source code in src/holodeck/tools/common.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
discover_files¶
discover_files(source_path, extensions=None)
¶
Discover files to ingest from a source path.
Recursively traverses directories and filters by supported extensions. For single files, validates the extension is supported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_path
|
Path
|
Resolved path (file or directory) to discover from |
required |
extensions
|
frozenset[str] | None
|
Set of supported extensions (default: SUPPORTED_EXTENSIONS) |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
List of Path objects for files to process, sorted for deterministic order |
Note
This function does not validate file existence - that should be checked before calling this function.
Example
discover_files(Path("/docs")) [PosixPath('/docs/file1.md'), PosixPath('/docs/subdir/file2.txt')]
Source code in src/holodeck/tools/common.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
generate_placeholder_embeddings¶
generate_placeholder_embeddings(count, dimensions=1536)
¶
Generate placeholder embedding vectors for testing.
Creates zero-valued embedding vectors when no embedding service is available. Useful for testing and development without LLM API access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of embeddings to generate |
required |
dimensions
|
int
|
Embedding vector dimensions (default: 1536) |
1536
|
Returns:
| Type | Description |
|---|---|
list[list[float]]
|
List of zero-valued embedding vectors |
Example
embeddings = generate_placeholder_embeddings(3, 768) len(embeddings) 3 len(embeddings[0]) 768
Source code in src/holodeck/tools/common.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
holodeck.tools.vectorstore_tool¶
Provides semantic search over files and directories containing text data or structured data (CSV, JSON, JSONL files with field mapping). Supports automatic file discovery, text chunking, embedding generation, vector storage, and modification-time tracking for incremental ingestion.
VectorStoreTool¶
VectorStoreTool(config, base_dir=None, execution_config=None)
¶
Bases: EmbeddingServiceMixin, DatabaseConfigMixin
Vectorstore tool for semantic search over unstructured data.
This tool enables agents to perform semantic search over documents by: 1. Discovering files from configured source (file or directory) 2. Converting files to markdown using FileProcessor 3. Chunking text for optimal embedding generation 4. Generating embeddings via Semantic Kernel services 5. Storing document chunks in a vector database 6. Performing similarity search on queries
Inherits from
EmbeddingServiceMixin: Provides set_embedding_service() method DatabaseConfigMixin: Provides database config resolution and collection creation
Attributes:
| Name | Type | Description |
|---|---|---|
config |
Tool configuration from agent.yaml |
|
is_initialized |
bool
|
Whether the tool has been initialized |
document_count |
int
|
Number of document chunks stored |
last_ingest_time |
datetime | None
|
Timestamp of last ingestion |
Example
config = VectorstoreTool( ... name="knowledge_base", ... description="Search product docs", ... source="data/docs/" ... ) tool = VectorStoreTool(config) await tool.initialize() results = await tool.search("How do I authenticate?")
Initialize VectorStoreTool with configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
VectorstoreTool
|
VectorstoreTool configuration from agent.yaml containing: - name: Tool identifier - description: Tool description - source: File or directory path to ingest - embedding_model: Optional custom embedding model - database: Optional database configuration - top_k: Number of results to return (default: 5) - min_similarity_score: Minimum score threshold (optional) - chunk_size: Text chunk size in tokens (optional) - chunk_overlap: Chunk overlap in tokens (optional) |
required |
base_dir
|
str | None
|
Base directory for resolving relative source paths. If None, source paths are resolved relative to current working directory. |
None
|
execution_config
|
ExecutionConfig | None
|
Execution configuration for file processing timeouts and caching. If None, default FileProcessor settings are used. |
None
|
Source code in src/holodeck/tools/vectorstore_tool.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
initialize(force_ingest=False, provider_type=None, progress_callback=None)
async
¶
Initialize tool and ingest source files.
Discovers files from the configured source, processes them into chunks, generates embeddings, and stores them in the vector database. Source path is resolved relative to base_dir if set.
For structured data mode (when vector_field is configured), loads structured data from CSV/JSON/JSONL files with field mapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_ingest
|
bool
|
If True, re-ingest all files regardless of modification time. |
False
|
provider_type
|
str | None
|
LLM provider for dimension auto-detection (defaults to "openai" if not specified) |
None
|
progress_callback
|
Callable[[int, int | None], None] | None
|
Optional callback invoked after each file is
processed (or skipped). Called as |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the source path doesn't exist. |
RuntimeError
|
If no supported files are found in source. |
ConfigError
|
If configured fields don't exist in source (structured mode). |
Source code in src/holodeck/tools/vectorstore_tool.py
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | |
search(query)
async
¶
Execute semantic search and return formatted results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Natural language search query. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted string with search results including scores and sources. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If tool not initialized. |
ValueError
|
If query is empty. |
Source code in src/holodeck/tools/vectorstore_tool.py
840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | |
set_embedding_service(service)
¶
Set the embedding service for generating embeddings.
This method allows AgentFactory to inject a Semantic Kernel TextEmbedding service for generating real embeddings instead of placeholder zeros.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
Any
|
Semantic Kernel TextEmbedding service instance (OpenAITextEmbedding or AzureTextEmbedding). |
required |
Source code in src/holodeck/tools/base_tool.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
holodeck.tools.hierarchical_document_tool¶
Provides intelligent document search that understands document structure, extracts definitions, and generates optimized context for LLM consumption. Supports semantic, keyword (BM25), and hybrid search modes with configurable weights.
HierarchicalDocumentTool¶
HierarchicalDocumentTool(config, base_dir=None)
¶
Bases: EmbeddingServiceMixin, DatabaseConfigMixin
Semantic Kernel tool for hierarchical document retrieval.
This tool provides intelligent document search that understands document structure, extracts definitions, and generates optimized context for LLM consumption.
Inherits from
EmbeddingServiceMixin: Provides set_embedding_service() method DatabaseConfigMixin: Provides database config resolution and collection creation
Attributes:
| Name | Type | Description |
|---|---|---|
config |
Tool configuration from HierarchicalDocumentToolConfig. |
|
chunks |
Indexed document chunks. |
Example
from holodeck.models.tool import HierarchicalDocumentToolConfig config = HierarchicalDocumentToolConfig( ... name="doc_search", ... description="Search policy documents", ... source="./docs/policy.md" ... ) tool = HierarchicalDocumentTool(config) await tool.initialize() results = await tool.search("What are the reporting requirements?")
Initialize the hierarchical document tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
HierarchicalDocumentToolConfig
|
Tool configuration from HierarchicalDocumentToolConfig. |
required |
base_dir
|
str | None
|
Optional base directory for resolving relative source paths. If None, source paths are resolved relative to current working directory or agent_base_dir context variable. |
None
|
Source code in src/holodeck/tools/hierarchical_document_tool.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
initialize(force_ingest=True, provider_type=None, progress_callback=None)
async
¶
Initialize the tool by processing all configured documents.
This method should be called before any search operations. It loads documents, chunks them, extracts definitions, and indexes content for search.
Uses mtime-based incremental ingestion to skip unchanged files. Files are only re-ingested if their modification time is newer than the stored record's mtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_ingest
|
bool
|
If True, re-ingest all files regardless of modification time. Existing records will be deleted before re-ingestion. |
True
|
provider_type
|
str | None
|
LLM provider for dimension auto-detection (defaults to "openai" if not specified). |
None
|
progress_callback
|
Callable[[int, int | None], None] | None
|
Optional callback invoked after each file is
processed (or skipped). Called as |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If a document file is not found. |
Source code in src/holodeck/tools/hierarchical_document_tool.py
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 | |
search(query, top_k=None)
async
¶
Search documents for content relevant to query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
top_k
|
int | None
|
Override configured top_k. |
None
|
Returns:
| Type | Description |
|---|---|
list[SearchResult]
|
List of SearchResult objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If tool is not initialized. |
ValueError
|
If query is empty. |
Source code in src/holodeck/tools/hierarchical_document_tool.py
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | |
get_context(query, max_tokens=None)
async
¶
Get LLM-ready context for a query.
This is a convenience method that searches and formats results into a single context string suitable for LLM prompts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Query to get context for. |
required |
max_tokens
|
int | None
|
Maximum tokens for context (currently unused). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted context string. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If tool is not initialized. |
Source code in src/holodeck/tools/hierarchical_document_tool.py
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | |
get_definition(term)
¶
Look up a term's definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
term
|
str
|
Term to look up. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str] | None
|
Dictionary with 'term' and 'definition' keys, or None. |
Source code in src/holodeck/tools/hierarchical_document_tool.py
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | |
set_embedding_service(service)
¶
Set the embedding service for generating embeddings.
This method allows AgentFactory to inject a Semantic Kernel TextEmbedding service for generating real embeddings instead of placeholder zeros.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
Any
|
Semantic Kernel TextEmbedding service instance (OpenAITextEmbedding or AzureTextEmbedding). |
required |
Source code in src/holodeck/tools/base_tool.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
set_context_generator(generator)
¶
Set the context generator for contextual embeddings.
Accepts any ContextGenerator protocol implementation (LLMContextGenerator, ClaudeSDKContextGenerator, etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
generator
|
Any
|
A ContextGenerator protocol implementation. |
required |
Source code in src/holodeck/tools/hierarchical_document_tool.py
146 147 148 149 150 151 152 153 154 155 | |
set_chat_service(service)
¶
Set the chat service for LLM context generation.
This enables contextual embeddings via the LLMContextGenerator. When contextual_embeddings is enabled in config, this also creates the LLMContextGenerator instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
Any
|
Semantic Kernel ChatCompletion service instance. |
required |
Source code in src/holodeck/tools/hierarchical_document_tool.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
to_semantic_kernel_function()
¶
Convert this tool to a Semantic Kernel function.
Returns:
| Type | Description |
|---|---|
Any
|
Semantic Kernel function wrapper. |
Source code in src/holodeck/tools/hierarchical_document_tool.py
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | |
holodeck.tools.mcp¶
MCP (Model Context Protocol) tool module for integrating external MCP servers. Provides a factory for creating Semantic Kernel MCP plugins, utility functions, and a dedicated error hierarchy.
holodeck.tools.mcp.factory¶
create_mcp_plugin¶
create_mcp_plugin(config)
¶
Create an SK MCP plugin based on transport type.
This factory function creates the appropriate Semantic Kernel MCP plugin based on the transport type specified in the configuration. Each transport type maps to a specific SK plugin:
Transport mapping: - stdio -> MCPStdioPlugin - sse -> MCPSsePlugin - websocket -> MCPWebsocketPlugin - http -> MCPStreamableHttpPlugin
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
MCPTool
|
MCP tool configuration from agent.yaml |
required |
Returns:
| Type | Description |
|---|---|
MCPStdioPlugin
|
MCPStdioPlugin instance. Other transport types (SSE, WebSocket, HTTP) |
MCPStdioPlugin
|
will return their respective plugin types when implemented. |
Raises:
| Type | Description |
|---|---|
MCPConfigError
|
If transport type is not supported or not yet implemented |
Example
config = MCPTool( ... name="filesystem", ... description="File operations", ... command=CommandType.NPX, ... args=["-y", "@modelcontextprotocol/server-filesystem"], ... ) plugin = create_mcp_plugin(config)
plugin is an MCPStdioPlugin instance¶
Source code in src/holodeck/tools/mcp/factory.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
holodeck.tools.mcp.utils¶
normalize_tool_name¶
normalize_tool_name(name)
¶
Normalize tool name by replacing invalid characters with '-'.
Per Semantic Kernel pattern, tool names must be valid identifiers. This method replaces any character that is not alphanumeric or underscore with a hyphen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Original tool name from MCP server |
required |
Returns:
| Type | Description |
|---|---|
str
|
Normalized name safe for use as identifier |
Example
normalize_tool_name("read.file") 'read-file' normalize_tool_name("read/write") 'read-write' normalize_tool_name("read_file_v2") 'read_file_v2'
Source code in src/holodeck/tools/mcp/utils.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
holodeck.tools.mcp.errors¶
MCP-specific error hierarchy extending the base HoloDeck error types.
HoloDeckError
├── ConfigError
│ └── MCPConfigError # Invalid MCP configuration
└── MCPError # Base MCP runtime error
├── MCPConnectionError # Failed to connect to server
│ └── MCPTimeoutError # Connection/request timeout
├── MCPProtocolError # Protocol-level error from server
└── MCPToolNotFoundError # Tool not found on server
MCPConfigError¶
MCPConfigError(field, message)
¶
Bases: ConfigError
MCP configuration error (invalid transport, missing fields, etc.).
Initialize MCP configuration error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
The configuration field that caused the error |
required |
message
|
str
|
Descriptive error message |
required |
Source code in src/holodeck/tools/mcp/errors.py
20 21 22 23 24 25 26 27 | |
MCPError¶
MCPError(message, server=None)
¶
Bases: HoloDeckError
Base exception for MCP runtime errors.
Initialize MCP error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Descriptive error message |
required |
server
|
str | None
|
MCP server identifier (optional) |
None
|
Source code in src/holodeck/tools/mcp/errors.py
33 34 35 36 37 38 39 40 41 | |
MCPConnectionError¶
MCPConnectionError(message, server=None, command=None)
¶
Bases: MCPError
Failed to connect to MCP server.
Initialize MCP connection error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Descriptive error message |
required |
server
|
str | None
|
MCP server identifier (optional) |
None
|
command
|
str | None
|
Command that was attempted (optional) |
None
|
Source code in src/holodeck/tools/mcp/errors.py
47 48 49 50 51 52 53 54 55 56 57 58 | |
MCPTimeoutError¶
MCPTimeoutError(message, server=None, timeout=None)
¶
Bases: MCPConnectionError
MCP server connection or request timeout.
Initialize MCP timeout error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Descriptive error message |
required |
server
|
str | None
|
MCP server identifier (optional) |
None
|
timeout
|
float | None
|
Timeout value that was exceeded (optional) |
None
|
Source code in src/holodeck/tools/mcp/errors.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
MCPProtocolError¶
MCPProtocolError(message, server=None, error_code=None)
¶
Bases: MCPError
MCP protocol-level error returned by server.
Initialize MCP protocol error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Descriptive error message |
required |
server
|
str | None
|
MCP server identifier (optional) |
None
|
error_code
|
int | None
|
MCP protocol error code (optional) |
None
|
Source code in src/holodeck/tools/mcp/errors.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
MCPToolNotFoundError¶
MCPToolNotFoundError(tool_name, server=None)
¶
Bases: MCPError
Tool not found on MCP server.
Initialize MCP tool not found error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_name
|
str
|
Name of the tool that was not found |
required |
server
|
str | None
|
MCP server identifier (optional) |
None
|
Source code in src/holodeck/tools/mcp/errors.py
104 105 106 107 108 109 110 111 112 | |