Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/enrichmcp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,16 @@ def delete(

return self._tool_decorator(ToolKind.DELETER, func, name=name, description=description)

def prompt(
self,
name: str | None = None,
title: str | None = None,
description: str | None = None,
) -> Callable[[F], F]:
"""Register a prompt via the underlying :class:`FastMCP` instance."""

return self.mcp.prompt(name=name, title=title, description=description)

def get_context(self) -> EnrichContext:
"""Return the current :class:`EnrichContext` for this app."""

Expand Down
17 changes: 17 additions & 0 deletions tests/test_prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from unittest.mock import Mock

from enrichmcp import EnrichMCP


def test_prompt_delegates_to_fastmcp():
app = EnrichMCP("Title", description="desc")
decorator = Mock(side_effect=lambda f: f)
app.mcp.prompt = Mock(return_value=decorator)

@app.prompt(name="foo", title="Foo", description="bar")
def fn():
pass

app.mcp.prompt.assert_called_once_with(name="foo", title="Foo", description="bar")
decorator.assert_called_once_with(fn)
assert fn.__name__ == "fn"
Loading