Class DefaultPromptRegistry
java.lang.Object
dev.tachyonmcp.core.server.features.AbstractRegistry<PromptDescriptor,dev.tachyonmcp.core.server.features.prompts.PromptEntry>
dev.tachyonmcp.core.server.features.prompts.DefaultPromptRegistry
- All Implemented Interfaces:
Prompts,PromptRegistry
@InternalApi
public class DefaultPromptRegistry
extends AbstractRegistry<PromptDescriptor,dev.tachyonmcp.core.server.features.prompts.PromptEntry>
implements PromptRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPromptRegistry(FeatureConfig config) Creates a prompt registry with the given feature configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns all registered prompt descriptors sorted by name.Finds a registered prompt descriptor by name.register(PromptDescriptor descriptor, PromptFn fn) Registers a prompt unless prompt support is disabled by the configured mode.registerAsync(PromptDescriptor descriptor, AsyncPromptFn fn) Registers a prompt with an asynchronous function.booleanunregister(String name) Removes the registered prompt with the specified name.Methods inherited from class dev.tachyonmcp.core.server.features.AbstractRegistry
addItem, addItemIfAbsent, defaultPageSize, fireOnChange, get, getAll, isEmpty, list, list, listItems, onChange, removeItemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.tachyonmcp.api.server.features.prompts.Prompts
register, register, register, registerAsync
-
Constructor Details
-
DefaultPromptRegistry
Creates a prompt registry with the given feature configuration. `@param` config the feature configuration governing registry behavior and page size
-
-
Method Details
-
register
Registers a prompt unless prompt support is disabled by the configured mode. -
registerAsync
Description copied from interface:PromptsRegisters a prompt with an asynchronous function.- Specified by:
registerAsyncin interfacePrompts- Parameters:
descriptor- the prompt descriptorfn- the asynchronous prompt function- Returns:
- the prompt registry
-
unregister
Removes the registered prompt with the specified name.- Specified by:
unregisterin interfacePrompts- Parameters:
name- the name of the prompt to remove- Returns:
trueif a prompt was removed,falseif no matching prompt was registered
-
find
Finds a registered prompt descriptor by name. -
descriptors
Returns all registered prompt descriptors sorted by name.- Specified by:
descriptorsin interfacePrompts- Returns:
- the registered prompt descriptors in ascending name order
-