Skip to content

CodeToolRequest

Base classes

Name Children Inherits
BaseSchema
mcp_server_llmling.injection.models
Base schema with shared configuration.

⋔ Inheritance diagram

graph TD
  3529263075["models.CodeToolRequest"]
  3548594046["models.BaseSchema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3548594046 --> 3529263075
  3879467795 --> 3548594046
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseSchema

Request model for registering a tool from code.

Source code in src/mcp_server_llmling/injection/models.py
class CodeToolRequest(BaseSchema):
    """Request model for registering a tool from code."""

    name: str
    """Name for the new tool."""

    code: str
    """Python code defining the tool function."""

    description: str | None = None
    """Optional tool description."""

code instance-attribute

code: str

Python code defining the tool function.

description class-attribute instance-attribute

description: str | None = None

Optional tool description.

name instance-attribute

name: str

Name for the new tool.

:fa-brands-github: Show source on GitHub