MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / create

Method create

server/src/db/agent-context-db.ts:282–326  ·  view source on GitHub ↗

* Create a new agent context

(input: CreateAgentContextInput)

Source from the content-addressed store, hash-verified

280 * Create a new agent context
281 */
282 async create(input: CreateAgentContextInput): Promise<AgentContext> {
283 const result = await query(
284 `INSERT INTO agent_contexts (
285 organization_id,
286 agent_url,
287 agent_name,
288 agent_type,
289 protocol,
290 created_by
291 ) VALUES ($1, $2, $3, $4, $5, $6)
292 RETURNING
293 id,
294 organization_id,
295 agent_url,
296 agent_name,
297 agent_type,
298 protocol,
299 FALSE as has_auth_token,
300 auth_token_hint,
301 auth_type,
302 FALSE as has_oauth_token,
303 FALSE as has_oauth_refresh_token,
304 oauth_token_expires_at,
305 FALSE as has_oauth_client,
306 tools_discovered,
307 last_discovered_at,
308 last_test_scenario,
309 last_test_passed,
310 last_test_summary,
311 last_tested_at,
312 total_tests_run,
313 created_at,
314 updated_at,
315 created_by`,
316 [
317 input.organization_id,
318 input.agent_url,
319 input.agent_name || null,
320 input.agent_type || 'unknown',
321 input.protocol || 'mcp',
322 input.created_by || null,
323 ]
324 );
325 return result.rows[0];
326 }
327
328 /**
329 * Update an agent context

Callers 15

reviewSnapshotFunction · 0.80
mainFunction · 0.80
buildTarballFunction · 0.80
mainFunction · 0.80
fFunction · 0.80
aFunction · 0.80
hFunction · 0.80
SFunction · 0.80
rFunction · 0.80
submitBatchFunction · 0.80
completeFunction · 0.80

Calls 1

queryFunction · 0.85

Tested by

no test coverage detected