- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::nsmcp::CodeDefinitionTool
::nsmcp::CodeDefinitionToolcreate ... \
[ -adminExample (default "") ] \
[ -adminSummary (default "") ] \
[ -description (default "Retrieve the current loaded definition of an exact Tcl proc or NX/XOTcl method. Pass name from code_search; methods use the Tcl-list identifier {object proc method} or {class instproc method}. Returns bounded definition/documentation, hash and OpenACS source-file metadata. No invocation, file read or network request. Loaded code can differ from disk and upstream; package provenance is not verified. Scoped foreign interpreters are unsupported.") ] \
[ -inputSchema (default "{"type":"object","properties":{"name":{"type":"string"},"offset":{"type":"integer","minimum":0},"maxCharacters":{"type":"integer","minimum":1,"maximum":32768}},"required":["name"],"additionalProperties":false}") ] \
[ -name (default "code_definition") ] \
[ -outputSchema (default "") ] \
[ -permission (default "diagnostics.code.read") ]
Defined in /usr/local/ns/tcl/nsmcp/code-tools.tcl
Class Relations
Methods (to be applied on instances)
execute (scripted, public)
<instance of nsmcp::CodeDefinitionTool> execute context \ arguments
Retrieve a bounded definition from the current interpreter. Include source metadata and a loaded-definition hash; disk and upstream contents are not verified.
- Parameters:
- context (required)
- Authenticated request context carrying the principal, grants and selected server.
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- A rooted JSON tool-result object, including availability or job metadata as appropriate.
- Testcases:
- No testcase defined.
validate (scripted, public)
<instance of nsmcp::CodeDefinitionTool> validate arguments
Validate definition lookup and excerpt bounds. Decode the rooted JSON argument object and enforce this tool's option, range and combination constraints.
- Parameters:
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- An empty result on success; invalid input raises RPC error -32602.
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
![[i]](/resources/acs-subsite/ZoomIn16.gif)