Also, it appears that NS might be eliding `outputS...
# ai-netsuite
s
Also, it appears that NS might be eliding
outputSchema
from the tools definition JSON? Has anyone confirmed that using a client that reveals the raw MCP
tools/list
command output? (thisis based on my light experimentation with the standard claud.ai chat)
m
Are you talking about the below sample payload extracted when Claude makes the MCP Tool Call?
Copy code
{
  "jsonrpc": "2.0",
  "id": "{{$guid}}",
  "method": "tools/call",
  "params": {
    "name": "runCustomSuiteQL",
    "arguments": {
      "sqlQuery": "SELECT entityid, firstname, lastname FROM customer WHERE 1=1 AND rownum < 11"
    }
  }
}
s
no, I was asking claude about the MCP definitions of the custom tools I created, and it is able to show me the tool schema, but it only shows the
inputSchema
not the
outputSchema
. Not sure I can trust it but I went on to ask if it sees the outputSchema (which I indeed have defined for all my tools) and it said it cannot
interestingly, I later noticed in the NS help that claims chatgpt requires
outputSchema
but claude doesn't? In any case, I consider the output schema to be pretty important to help an AI reliably understand the response from a custom tool
m
How did you specify the output schema? Please share your sample JSON e.g. and the official doc pointing to it please?
s
Not sure what you mean by 'official doc' but here's example JSON describing a
helloWorld
tool that returns a message
Copy code
{
      "name": "helloWorld",
      "description": "Returns a friendly greeting.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "foo": {
            "type": "string",
            "description": "Optional input string to include in the greeting."
          }
        },
        "required": []
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The greeting message."
          }
        },
        "required": ["message"]
      }
    },
as for documentation, here is where output schema is described https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema
m
If you are using ChatGPT, defining which schema properties are nullable is required. The following sample is the JSON schema definition for the custom tools when using ChatGPT.
Copy code
{
  "tools": [
    {
      "name": "add",
      "description": "Add two numbers together",
      "inputSchema": {
        "type": "object",
        "properties": {
          "a": {
            "type": "number",
            "description": "First addend"
          },
          "b": {
            "type": "number",
            "description": "Second addend"
          }
        },
        "required": [
          "a",
          "b"
        ],
        "nullable": []
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "result": {
            "type": "number",
            "description": "Value of adding the two input numbers"
          },
          "error": {
            "type": "string",
            "description": "Error message if execution fails"
          }
        },
        "required": [
          "result"
        ],
        "nullable": [
          "error"
        ]
      },
      "annotations": {
        "title": "Add Numbers",
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    }
  ]
}