agent-as-model

v0.2.0
io.github.fernandogarzaaa/agent-as-model Checked 4 days ago Published 1 month ago

A true MCP server where the agent is the model and the API key.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

chat_complete

Generate a chat completion from an OpenAI chat-completions-shaped request. The completion is produced by the host agent's own model: direct MCP sampling on pre-2026-07-28 connections, an MRTR InputRequiredResult carrying the request payload on 2026-07-28+. When output_schema is given, the request carries exactly one required tool whose input schema is that schema, and the validated structured completion is returned as JSON text. When tools is given, the tool definitions are forwarded to the host's model with tool_choice, but only if the host advertised the sampling.tools capability: otherwise…

ParameterTypeDescription
messages *arrayChat messages; system roles become the system prompt.
max_tokensintegerMaximum tokens to generate.
modelstringModel alias; agent-default means the host's own model.
output_schemaOptional JSON Schema (root type object). When given, the sampling request carries exactly one required tool with this input schema and the completion is validated against it before returning.
personaOptional persona contract for this call: {name, input_schema, output_schema}. name is required and non-empty; the server is stateless and keeps no persona registry. When input_schema is given, the req…
previous_response_idOptional session cursor for host-owned multi-turn continuations. The server keeps no session state: pass the accumulated history back in messages and the previous turn's cursor here. '' starts a curso…
temperatureSampling temperature, if the host honors it.
tool_choiceOptional tool-choice mode, forwarded with tools; defaults to 'auto' when tools are given.
toolsOptional tool definitions to forward to the host's model. Each is {name, description, input_schema} where input_schema is a JSON Schema object with root type 'object'. Forwarded only when the host adv…

messages_create

Generate a completion from an Anthropic messages-shaped request. The completion is produced by the host agent's own model: direct MCP sampling on pre-2026-07-28 connections, an MRTR InputRequiredResult carrying the request payload on 2026-07-28+. When output_schema is given, the request carries exactly one required tool whose input schema is that schema, and the validated structured completion is returned as JSON text. When tools is given, the tool definitions are forwarded to the host's model with tool_choice, but only if the host advertised the sampling.tools capability: otherwise the tools…

ParameterTypeDescription
messages *arrayUser/assistant messages in order.
max_tokensintegerMaximum tokens to generate.
modelstringModel alias; agent-default means the host's own model.
output_schemaOptional JSON Schema (root type object). When given, the sampling request carries exactly one required tool with this input schema and the completion is validated against it before returning.
personaOptional persona contract for this call: {name, input_schema, output_schema}. name is required and non-empty; the server is stateless and keeps no persona registry. When input_schema is given, the req…
previous_response_idOptional session cursor for host-owned multi-turn continuations. The server keeps no session state: pass the accumulated history back in messages and the previous turn's cursor here. '' starts a curso…
systemSystem prompt as text or text blocks.
temperatureSampling temperature, if the host honors it.
tool_choiceOptional tool-choice mode, forwarded with tools; defaults to 'auto' when tools are given.
toolsOptional tool definitions to forward to the host's model. Each is {name, description, input_schema} where input_schema is a JSON Schema object with root type 'object'. Forwarded only when the host adv…

responses_create

Generate a completion from an OpenAI Responses-shaped request, returning the Responses API response object. The completion is produced by the host agent's own model: direct MCP sampling on pre-2026-07-28 connections, an MRTR InputRequiredResult carrying the request payload on 2026-07-28+. `input` is a string or a list of input items; each item is {role, content} with role user, assistant, system, or developer, and content a string or a list of text parts ({type: 'input_text'|'text', input_text: '...'}). A string input becomes one user message. System and developer items fold into the system pr…

ParameterTypeDescription
input *The Responses API input: a string, which becomes one user message, or a list of input items {role, content}. role is user, assistant, system, or developer; content is a string or a list of text parts…
instructionsOptional system prompt; leads the system/developer items.
max_tokensintegerMaximum tokens to generate. Named max_tokens for uniformity with the other tools; the Responses API calls it max_output_tokens.
modelstringModel alias; agent-default means the host's own model.
output_schemaOptional JSON Schema (root type object). When given, the sampling request carries exactly one required tool with this input schema and the completion is validated against it before returning.
personaOptional persona contract for this call: {name, input_schema, output_schema}. name is required and non-empty; the server is stateless and keeps no persona registry. When input_schema is given, the req…
previous_response_idOptional session cursor for host-owned multi-turn continuations. The server keeps no session state: pass the accumulated history back in input and the previous turn's response id here. '' starts a cur…
temperatureSampling temperature, if the host honors it.
tool_choiceOptional tool-choice mode, forwarded with tools; defaults to 'auto' when tools are given.
toolsOptional tool definitions to forward to the host's model. Each is {name, description, input_schema} where input_schema is a JSON Schema object with root type 'object'. Forwarded only when the host adv…

generate

Generate a raw text completion from a plain prompt string. The prompt is sent as a single user sampling message with no system prompt and no chat formatting: raw prompt in, completion text out, produced by the host agent's own model. Same model hint and parameters as the other completion tools, minus any chat or tool features: no tools, no output_schema, no tool_choice. It does accept the optional persona contract ({name, input_schema, output_schema}): request/response validation only, never a sampling feature, so the thin path stays zero overhead. Session cursors: the server keeps no session…

ParameterTypeDescription
prompt *stringThe raw prompt text to complete. No chat formatting applied.
max_tokensintegerMaximum tokens to generate.
modelstringModel alias; agent-default means the host's own model.
personaOptional persona contract for this call: {name, input_schema, output_schema}. name is required and non-empty; the server is stateless and keeps no persona registry. When input_schema is given, the req…
previous_response_idOptional session cursor for host-owned continuations. '' mints a cursor over the current prompt and completion, returned as JSON '{"completion": "<text>", "response_id": "cur_<...>"}' instead of plain…
temperatureSampling temperature, if the host honors it.

list_models

List the models this server offers. There is exactly one: agent-default, an alias for the host agent's own model.