docs: cover the remaining Tier 1 audit items (#3325)
This commit is contained in:
parent
2a1cc94493
commit
9057285683
1 changed files with 247 additions and 1 deletions
18
docs_src/media/tutorial005.py
Normal file
18
docs_src/media/tutorial005.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from mcp.server import MCPServer
|
||||
from mcp.types import EmbeddedResource, TextResourceContents
|
||||
|
||||
mcp = MCPServer("Brand kit")
|
||||
|
||||
|
||||
@mcp.resource("brand://guidelines", mime_type="text/markdown")
|
||||
def guidelines() -> str:
|
||||
"""How to use the brand assets."""
|
||||
return "# Brand guidelines\n\nUse the primary colour for calls to action.\n"
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def brand_guidelines() -> EmbeddedResource:
|
||||
"""The brand guidelines as a Markdown document."""
|
||||
return EmbeddedResource(
|
||||
resource=TextResourceContents(uri="brand://guidelines", mime_type="text/markdown", text=guidelines())
|
||||
)
|
||||
Loading…
Reference in a new issue