{
  "name": "com.linkrra/synap",
  "title": "Synap402",
  "version": "1.2.1",
  "description": "Discover models, estimate costs and run authorized OpenAI-compatible inference.",
  "websiteUrl": "https://pool.linkrra.com/mcp-guide",
  "icons": [
    {
      "src": "https://pool.linkrra.com/synap-x402-icon.svg",
      "mimeType": "image/svg+xml"
    }
  ],
  "remotes": [
    {
      "type": "streamable-http",
      "url": "https://pool.linkrra.com/mcp"
    }
  ],
  "serverUrl": "https://pool.linkrra.com/mcp",
  "tools": [
    {
      "name": "synap_chat_completion",
      "title": "Run a chat completion on Synap",
      "description": "Send a conversation to a model on Synap, Linkrra's OpenAI-compatible inference API, and get the model's reply. Use this when you need text generated, code written or a question answered by one of the open models Synap serves. This is the only tool here that costs money: it bills prompt and completion tokens to the Synap API key supplied as the Authorization: Bearer header on the MCP connection. With no key it returns an error and nothing is spent; a key with no balance returns insufficient_credits. Call synap_estimate_cost first if the price matters. Returns the standard OpenAI chat.completion JSON (choices[0].message.content holds the reply, usage holds token counts). The call is not streamed and keeps no memory between calls \u2014 send the full message history each time.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model id exactly as returned by synap_list_models, e.g. \"qwen3-coder-30b\". Use \"synap-v1\" to let Synap pick the cheapest model that can handle the request."
          },
          "messages": {
            "type": "array",
            "description": "The conversation so far, oldest first. The last message is normally the user turn to answer.",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "system",
                    "user",
                    "assistant"
                  ],
                  "description": "Who wrote the message: system (instructions), user, or assistant (an earlier model reply)."
                },
                "content": {
                  "type": "string",
                  "description": "The message text."
                }
              },
              "required": [
                "role",
                "content"
              ]
            }
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Sampling randomness, 0 to 2. Lower is more deterministic. Omit to use the model default."
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Upper limit on tokens generated in the reply. Omit to use the model default; lower it to cap cost."
          }
        },
        "required": [
          "model",
          "messages"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true
      },
      "outputSchema": {
        "type": "object",
        "required": [
          "choices"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "finish_reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    {
      "name": "synap_list_models",
      "title": "List Synap models and prices",
      "description": "List the models Synap serves right now, each with its price per million tokens, context window and what it is good at. Use this to choose a model id before calling synap_chat_completion, or to compare prices. Free, read-only, no API key needed, and safe to call repeatedly; the list is live, so models can appear or go between calls. Returns {\"object\":\"list\",\"count\":N,\"data\":[{id,name,capability,tier,context_tokens,max_output_tokens,pricing,data_policy}]}; pricing is USD per million prompt and completion tokens and is absent for the auto-routing ids (\"synap-v1\"), which bill at the price of the model they route to. For every field of one model use synap_get_model.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Optional case-insensitive filter matched against model id, name and capability, e.g. \"coder\", \"qwen\" or \"vision\". Omit to list everything."
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "type": "object",
        "required": [
          "object",
          "count",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "count": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "context_tokens": {
                  "type": "number"
                },
                "max_output_tokens": {
                  "type": "number"
                },
                "pricing": {
                  "type": "object",
                  "properties": {
                    "prompt_per_million": {
                      "type": "number"
                    },
                    "completion_per_million": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "synap_get_model",
      "title": "Get one Synap model in full",
      "description": "Return the complete catalogue record for one Synap model: pricing, context and output limits, supported parameters, quantisation, data-retention policy and readiness. Use this after synap_list_models when you need details the summary leaves out. Free, read-only and needs no API key. Returns the raw model object, or an error naming the id if Synap does not serve it.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model id exactly as returned by synap_list_models."
          }
        },
        "required": [
          "model"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "context_tokens": {
            "type": "number"
          },
          "max_output_tokens": {
            "type": "number"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "prompt_per_million": {
                "type": "number"
              },
              "completion_per_million": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    {
      "name": "synap_estimate_cost",
      "title": "Estimate the cost of a Synap call",
      "description": "Work out what a chat completion would cost on Synap from token counts, using the live price list. Use this before synap_chat_completion when budget matters, or to compare models for a job. Free, read-only, needs no API key and runs no model. Returns {model, prompt_tokens, completion_tokens, prompt_usd, completion_usd, total_usd, pricing}. It is an estimate: the real charge uses the token counts the model reports afterwards. Auto-routing ids such as \"synap-v1\" have no fixed price and return an error saying so.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model id exactly as returned by synap_list_models."
          },
          "prompt_tokens": {
            "type": "integer",
            "minimum": 0,
            "description": "Tokens you will send (system + conversation). Roughly 4 characters of English per token."
          },
          "completion_tokens": {
            "type": "integer",
            "minimum": 0,
            "description": "Tokens you expect back. Use your max_tokens for a worst case. Defaults to 0."
          }
        },
        "required": [
          "model",
          "prompt_tokens"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "type": "object",
        "required": [
          "model",
          "prompt_tokens",
          "completion_tokens",
          "prompt_usd",
          "completion_usd",
          "total_usd",
          "pricing"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "prompt_tokens": {
            "type": "number"
          },
          "completion_tokens": {
            "type": "number"
          },
          "prompt_usd": {
            "type": "number"
          },
          "completion_usd": {
            "type": "number"
          },
          "total_usd": {
            "type": "number"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "prompt_per_million": {
                "type": "number"
              },
              "completion_per_million": {
                "type": "number"
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      }
    }
  ]
}
