Rebuild the docs around tested examples; shrink README.v2.md to a pitch (#2978)
This commit is contained in:
parent
4caa41f6d5
commit
411a6d3980
1 changed files with 9510 additions and 2639 deletions
16
docs_src/prompts/tutorial003.py
Normal file
16
docs_src/prompts/tutorial003.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from typing import Annotated
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from mcp.server import MCPServer
|
||||
|
||||
mcp = MCPServer("Code Helper")
|
||||
|
||||
|
||||
@mcp.prompt(title="Code review")
|
||||
def review_code(
|
||||
code: Annotated[str, Field(description="The code to review.")],
|
||||
language: Annotated[str, Field(description="The language the code is written in.")] = "python",
|
||||
) -> str:
|
||||
"""Review a piece of code."""
|
||||
return f"Please review this {language} code:\n\n{code}"
|
||||
Loading…
Reference in a new issue