Class ::nsmcp::Tool (public)

 ::nx::Class ::nsmcp::Tool[i]

Defined in /usr/local/ns/tcl/nsmcp/lib/tools.tcl

Testcases:
No testcase defined.
Source code:
    :property name:required
    :property description:required
    :property permission:required
    :property {outputSchema {}}
    :property {inputSchema {{} object {type string object properties object {} additionalProperties boolean false}}}
    :public method name {} {return ${:name}}
    :public method permission {} {return ${:permission}}
    :public method describe {} {
        set members [list name string ${:name}  description string ${:description} inputSchema object [lindex ${:inputSchema} 2]  annotations object {readOnlyHint boolean true destructiveHint boolean false openWorldHint boolean false}]
        if {${:outputSchema} ne ""} {
            lappend members outputSchema object [lindex ${:outputSchema} 2]
        }
        return [list {} object $members]
    }
    :public method validate {arguments} {
        # The first tool accepts exactly {}. Subclasses must override this
        # together with inputSchema; no partial JSON Schema validator is claimed.
        if {[lindex $arguments 1] ne "object" || [lindex $arguments 2] ne ""} {
            return -code error -errorcode {NSMCP RPC -32602} "Expected an empty arguments object"
        }
    }
    :public method execute {context arguments} {error "abstract Tool.execute"}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: