Back to Smithery

Get a server

docs-api-reference-servers-get-a-server.md

latest7.9 KB
Original Source

GET

/

servers

/

{qualifiedName}

Try it

JavaScript

JavaScript

import Smithery from '@smithery/api';

const client = new Smithery({
  apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});

const server = await client.servers.get('qualifiedName');

console.log(server.connections);
curl --request GET \
  --url https://api.smithery.ai/servers/{qualifiedName} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.smithery.ai/servers/{qualifiedName}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.smithery.ai/servers/{qualifiedName}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smithery.ai/servers/{qualifiedName}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.smithery.ai/servers/{qualifiedName}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.smithery.ai/servers/{qualifiedName}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body

200

404

{
  "qualifiedName": "smithery/hello-world",
  "displayName": "Hello World",
  "description": "A simple hello world server",
  "iconUrl": "https://example.com/icon.png",
  "remote": true,
  "deploymentUrl": "https://api.example.com",
  "connections": [
    {
      "type": "stdio",
      "bundleUrl": "<string>",
      "runtime": "node",
      "configSchema": {}
    }
  ],
  "security": {
    "scanPassed": true
  },
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "outputSchema": {
        "type": "object",
        "properties": {},
        "required": [
          "<string>"
        ]
      }
    }
  ],
  "resources": [
    {
      "name": "config://settings",
      "uri": "config://app/settings",
      "description": "Application settings",
      "mimeType": "application/json"
    }
  ],
  "prompts": [
    {
      "name": "summarize",
      "description": "Summarize the given text",
      "arguments": [
        {
          "name": "text",
          "description": "The text to summarize",
          "required": true
        }
      ]
    }
  ]
}
{
  "error": "Server not found"
}

Authorizations

[​

](#authorization-authorization)

Authorization

string

header

required

Smithery API key as Bearer token

Path Parameters

[​

](#parameter-qualified-name)

qualifiedName

string

required

The server's qualified name (e.g. 'namespace/server' or 'namespace' for namespace-only servers). Use %2F to encode the slash.

Response

200

application/json

Server found

[​

](#response-qualified-name)

qualifiedName

string

required

Example:

"smithery/hello-world"

[​

](#response-display-name)

displayName

string

required

Example:

"Hello World"

[​

](#response-description)

description

string

required

Example:

"A simple hello world server"

[​

](#response-icon-url-one-of-0)

iconUrl

string | null

required

Example:

"https://example.com/icon.png"

[​

](#response-remote)

remote

boolean

required

Example:

true

[​

](#response-deployment-url-one-of-0)

deploymentUrl

string | null

required

Example:

"https://api.example.com"

[​

](#response-connections)

connections

object[]

required

Option 1

Option 2

Show child attributes

[​

](#response-security-one-of-0)

security

object | null

required

Show child attributes

[​

](#response-tools-one-of-0)

tools

object[] | null

required

Show child attributes

[​

](#response-resources-one-of-0)

resources

object[] | null

required

Show child attributes

[​

](#response-prompts-one-of-0)

prompts

object[] | null

required

Show child attributes

Was this page helpful?

YesNo

⌘I

JavaScript

JavaScript

import Smithery from '@smithery/api';

const client = new Smithery({
  apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});

const server = await client.servers.get('qualifiedName');

console.log(server.connections);
curl --request GET \
  --url https://api.smithery.ai/servers/{qualifiedName} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.smithery.ai/servers/{qualifiedName}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.smithery.ai/servers/{qualifiedName}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smithery.ai/servers/{qualifiedName}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.smithery.ai/servers/{qualifiedName}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.smithery.ai/servers/{qualifiedName}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body

200

404

{
  "qualifiedName": "smithery/hello-world",
  "displayName": "Hello World",
  "description": "A simple hello world server",
  "iconUrl": "https://example.com/icon.png",
  "remote": true,
  "deploymentUrl": "https://api.example.com",
  "connections": [
    {
      "type": "stdio",
      "bundleUrl": "<string>",
      "runtime": "node",
      "configSchema": {}
    }
  ],
  "security": {
    "scanPassed": true
  },
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "outputSchema": {
        "type": "object",
        "properties": {},
        "required": [
          "<string>"
        ]
      }
    }
  ],
  "resources": [
    {
      "name": "config://settings",
      "uri": "config://app/settings",
      "description": "Application settings",
      "mimeType": "application/json"
    }
  ],
  "prompts": [
    {
      "name": "summarize",
      "description": "Summarize the given text",
      "arguments": [
        {
          "name": "text",
          "description": "The text to summarize",
          "required": true
        }
      ]
    }
  ]
}
{
  "error": "Server not found"
}