Skip to content

api tool

Use api to read how to call a symbol before writing the call, as xpd api does. It returns the parameters as the source writes them, the summary, the members and the rules that may apply. Add a member to its class, as in pandas.DataFrame.merge, to read one method or property.

api(name)
  • Changes no file
  • A second call with the same arguments changes nothing more
  • Stays inside the project

Tags: discovery.

The server gives the agent this description of the tool.

Read a public dotted name's parameters, summary, own class members and rule links.

The name is a class or function that find returns, or a method or property of a class, such as pandas.DataFrame.merge. parameters_written holds each parameter as the source writes it, with its type annotation and default. A stub file writes ... for a default, which says only that the parameter is optional.

Type: string. Required.

A dotted name, such as pandas.DataFrame or pandas.DataFrame.merge.

The 15 fields of the result
Field Type Required Default Description
kind string yes
package string yes
name string yes
callable "class", "function", "method", "property" or null yes
parameters list of string yes
parameters_written list of string no The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional.
summary string yes
members list of object yes
members[].name string yes
members[].parameters list of string yes
members[].parameters_written list of string no The parameter list as the source writes it: each parameter with its type annotation and default, and a * or / that stands alone between parameters. A stub file writes ... for a default, which says only that the parameter is optional.
members[].summary string yes
members[].property boolean no false The member is read and not called.
rules list of string yes
signature string or null yes Return indexed parameter names. parameters_written has the defaults and kinds.
{"name":"arch.unitroot.KPSS.pvalue"}
{"kind":"symbol","package":"arch","name":"arch.unitroot.KPSS.pvalue","callable":"property","parameters":[],"parameters_written":[],"summary":"The p-value for the test statistic.","members":[],"rules":[],"signature":null}

A name that the index does not hold fails with the binary's message.

xpd api -- no.such.name exited with 2: xpd: no entry named no.such.name