MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / handle_get_prompt

Function handle_get_prompt

codewiki/mcp/tools/prompt_server.py:77–103  ·  view source on GitHub ↗

Return a prompt template, optionally with variables filled in.

(
    arguments: Dict[str, Any],
    store: SessionStore,
)

Source from the content-addressed store, hash-verified

75 "Save the result as overview.md."
76 ),
77 },
78}
79
80
81def handle_get_prompt(
82 arguments: Dict[str, Any],
83 store: SessionStore,
84) -> str:
85 """Return a prompt template, optionally with variables filled in."""
86 prompt_type = arguments["prompt_type"]
87 variables = arguments.get("variables", {})
88
89 if prompt_type not in _PROMPT_CATALOG:
90 available = list(_PROMPT_CATALOG.keys())
91 return json.dumps(
92 {
93 "error": f"Unknown prompt_type: {prompt_type}",
94 "available_types": available,
95 }
96 )
97
98 catalog_entry = _PROMPT_CATALOG[prompt_type]
99
100 # Resolve the prompt content
101 content = _resolve_prompt(prompt_type, variables)
102
103 result = {
104 "prompt_type": prompt_type,
105 "description": catalog_entry["description"],
106 "usage_hint": catalog_entry["usage_hint"],

Callers

nothing calls this directly

Calls 2

_resolve_promptFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected