MCP Tools Reference: apihub.googleapis.com

Tool: get_spec_contents

Get spec contents.

The following sample demonstrate how to use curl to invoke the get_spec_contents MCP tool.

Curl Request
  
curl  
--location  
 'https://apihub. REGION 
.rep.googleapis.com/mcp' 
  
 \ 
--header  
 'content-type: application/json' 
  
 \ 
--header  
 'accept: application/json, text/event-stream' 
  
 \ 
--data  
 '{ 
 "method": "tools/call", 
 "params": { 
 "name": "get_spec_contents", 
 "arguments": { 
 // provide these details according to the tool' 
s  
MCP  
specification  
 } 
  
 } 
,  
 "jsonrpc" 
:  
 "2.0" 
,  
 "id" 
:  
 1 
 } 
 ' 
  

Where, REGION is the supported API hub region. For more information, see Supported regions .

Input Schema

The GetSpecContents method's request.

GetSpecContentsRequest

JSON representation
 { 
 "name" 
 : 
 string 
 } 
Fields
name

string

Required. The name of the spec whose contents need to be retrieved. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}

Output Schema

The spec contents.

SpecContents

JSON representation
 { 
 "contents" 
 : 
 string 
 , 
 "mimeType" 
 : 
 string 
 } 
Fields
contents

string ( bytes format)

Required. The contents of the spec.

A base64-encoded string.

mimeType

string

Required. The mime type of the content for example application/json, application/yaml, application/wsdl etc.

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌

Create a Mobile Website
View Site in Mobile | Classic
Share by: