Model Context Protocol & OpenAI Native Function Calling for Real-Time Singapore Intelligence
Execute any of the 13 Singapore tools live via MCP JSON-RPC or OpenAI tool call format.
// Live execution output will appear here...
Import this OpenAPI Schema directly in the ChatGPT Custom GPT builder (Configure → Actions → Create new action):
Fetch real-time tools directly via GET /mcp/openai/tools:
import json
import requests
from openai import OpenAI
client = OpenAI()
# 1. Fetch live Singapore MCP tools from SingaNow
tools_url = "https://singanow.com/mcp/openai/tools"
tools = requests.get(tools_url).json()["tools"]
# 2. Ask GPT-4o with tool calling
messages = [
{"role": "system", "content": "You are an expert Singapore Assistant. Use SingaNow tools for real-time answers."},
{"role": "user", "content": "Check the next buses arriving at bus stop 01012 and current weather in Victoria."}
]
response = client.chat.completions.create(
model="gpt-4o",
messages=messages,
tools=tools,
tool_choice="auto"
)
# 3. Handle tool calls
msg = response.choices[0].message
if msg.tool_calls:
for tool_call in msg.tool_calls:
fn_name = tool_call.function.name
fn_args = json.loads(tool_call.function.arguments)
# Execute tool via SingaNow execution endpoint
exec_res = requests.post(
f"https://singanow.com/mcp/tools/{fn_name}",
json=fn_args
).json()
print(f"Tool [{fn_name}] Output:", json.dumps(exec_res, indent=2))
import OpenAI from "openai";
const openai = new OpenAI();
const BASE_URL = "https://singanow.com";
// 1. Fetch live SingaNow tools formatted for OpenAI
const res = await fetch(`${BASE_URL}/mcp/openai/tools`);
const { tools } = await res.json();
// 2. Send prompt to gpt-4o
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "system", content: "You are an expert Singapore local guide." },
{ role: "user", content: "Plan a bus journey from 01012 to 09048 and check live arrivals." }
],
tools
});
// 3. Inspect and execute returned tool calls
const toolCalls = completion.choices[0].message.tool_calls;
if (toolCalls) {
for (const call of toolCalls) {
const fnName = call.function.name;
const fnArgs = JSON.parse(call.function.arguments);
const toolResult = await fetch(`${BASE_URL}/mcp/tools/${fnName}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(fnArgs)
}).then(r => r.json());
console.log(`Executed ${fnName}:`, toolResult);
}
}
Add to claude_desktop_config.json:
{
"mcpServers": {
"singanow": {
"command": "node",
"args": ["path/to/mcp-bridge.mjs"],
"env": {
"MCP_URL": "https://singanow.com/mcp/"
}
}
}
}
Add to .cursor/mcp.json or Cursor Settings → MCP:
{
"mcpServers": {
"singanow": {
"url": "https://singanow.com/mcp/sse"
}
}
}
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"singanow": {
"serverUrl": "https://singanow.com/mcp/sse"
}
}
}
Direct JSON-RPC 2.0 invocation via cURL:
curl -X POST https://singanow.com/mcp/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_singapore_bus_arrivals",
"arguments": { "bus_stop_code": "01012" }
}
}'
Bypass proxy wrappers and middleware tax. Load the declarative UTCP Manual into any UTCP-compliant client or call tools directly via native HTTP:
curl -s -X POST "https://singanow.com/utcp/tools/get_singapore_bus_arrivals" \
-H "Content-Type: application/json" \
-d '{"bus_stop_code": "01012"}'
Pre-engineered prompts covering all 13 tools plus multi-tool workflows. Select any prompt to inspect its arguments and generate model-ready prompt messages.
// Generated prompt messages will appear here...
Contextual knowledge assets, guidelines, and real-time live data snapshots accessible via MCP resources/read.
// Click "Read Resource Content" to load...
Click any tool chip below to quickly populate the live tester and argument templates.